An indexer is a member that enables an object to be indexed in the same way as an array. Whereas properties enable field-like access, indexers enable array-like access.
The string class has one but it is read only e.q you only access the value at a given index but you cannot replace it using the indexer property.
Use one form of the Replace() function or combine it with IndexOf()/ IndexOfAny () to find a sepcific occurence of the char/string to replace.
-obislavu-
In practice, using regular strings is actually very efficient when the strings are small. I write a few very intensive string manipulation apps and using StringBuilder only boosts their performance when accumulating or adding on to very large strings.
For example, if you're parsing through a file a line at a time and manipulating one line at a time very intensively, you won't notice any performance boost with StringBuilder. You'll only notice better performance if you're accumulating those manipulated line into one string or manipulating the entire file as a single string.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.