SetAt() method in Net like CString class.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all.

Is there something similar to this in NET?

CString s( "abcdef");
s.SetAt(1, 'a');

I am looking for a method in the String class but I do not see anything.

Thanks in anticipation.
 
Tomas said:
Hello all.

Is there something similar to this in NET?

CString s( "abcdef");
s.SetAt(1, 'a');

I am looking for a method in the String class but I do not see anything.

..NET strings are immutable. This is so they can be copied by making a
second pointer to the same memory, instead of duplicating the content.

To set individual characters, use a System::Char[] instead. There is a
System::String::ToCharArray() method and overloaded String constructor to
make converting back and forth easy.
 
Back
Top