Insertion of Strings

Hi,
I have a little problem with the insertion of a String into another. Here is the code. I`m using C++/CLI and String are System::String^
The String Path comes from a SaveFileDialog. I'm looking for the char "." and before it I would like to introduce a number.
1
2
3
4
5
6
7
8
9
10
private: void SaveTheFrame(String^ path)
{
   int posit;
   String^ Num2Str;
   Num2Str = this->i.ToString();
   String^cadena = path; // I shoudn't modify path
   posit = cadena->IndexOf(".");
   cadena->Insert(posit,Num2Str);
   MessageBox::Show(cadena);
}

The conversion Number to string works and I get the right position of the dot too, but the insetion doesn't work.
What do you think about that??

Thanks in advance.
garrido
See http://msdn.microsoft.com/en-us/library/system.string.insert.aspx. String.Insert() returns a new string with the inserted text; it doesn't modify the original string.
Again a quick and helpfully antwort. Thanks a lot. It works like you say.
Thanks.
Saludos a Costa Rica de un espagnol en Alemania!!! :)
Topic archived. No new replies allowed.