C# String Manipulation

  • Thread starter Thread starter Jim McGivney
  • Start date Start date
J

Jim McGivney

Does anyone know of a concise article that covers string manipulation, such
as insert, join, pad, etc.
Thanks,
Jim
 
Jim McGivney said:
Does anyone know of a concise article that covers string manipulation, such
as insert, join, pad, etc.

I don't, but the basics are:

o Strings themselves are immutable. All the operations such as
Substring, PadLeft, PadRight etc return a reference to a *new* string
with the appropriate data in.

o To avoid making multiple copies of data, if you're doing lots of
operations without needing the intermediate results as strings,
consider using a StringBuilder.
 
Jim,
Charles Petzold's book "Programming Microsoft Windows with Microsoft Visual
Basic .NET" from MS Press, has an appendix on Strings and an appendix on
Streams that I find to be good concise articles on Strings & Streams.

There is a C# version of the above book available, I would expect the same
appendixes.

Hope this helps
Jay
 
Back
Top