regex - how modify my string for each ocurrence C#? -


i read

replace not modify string, creates new 1 requested modifications. else implementation detail, should not care about. if don't trust regex library, don't use it. if behaves want to, might change in future without further notice.

how use variable modification ?

regex.replace , string immutability

string immutable. means cannot modify existing string, can create new one.

however, can modify reference string.

for example:

var = "hello"; var b = a; b = "world";  console.writeline(a); console.writeline(b); 

output:

hello world 

this because when b = "world" called change reference b point "world", a still points "hello".


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -