c# - Large sized string by ref or value? -


i understand string sent value though reference type, if string tens of mb in size , wanted send argument.

should send reference or value?

private int getindexofnext(string string,int searchstartindex,char targetchar) 

or

private int getindexofnext(ref string string,int searchstartindex,char targetchar) 

i understand string sent value though reference type

for strings or other reference types, address passed value. not value gets passed, case doesn't matter. reason parameter passing involving strings looks different because strings immutable (and when try modify string's content).

you should see: parameter passing in c# jon skeet


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -