We help IT Professionals succeed at work.
Get Started

How to find a specific pattern in a string and replace it in C#

Skale asked
Last Modified: 2019-12-20
I have a term like sub_id() and i would like to change it to "x" from string like below;

$_PR_frsub_id()_tyu --> $_PR_frx_tyu

but problem it sometimes takes some value inside it like sub_id(12546) so it's not easy to replace it with sub_id() we have to define where first bracket starts and ends sub_id(n character)

$_PR_frsub_id(123456)_tyu --> $_PR_frx_tyu

Any help would be grateful.
Watch Question
This problem has been solved!
Unlock 2 Answers and 4 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE