6
Reply

string.insert problem

mreister

mreister

Nov 29 2003 8:59 PM
2.3k
I am trying to trim s3 off the end of stringToSplit. It splits into the array ok but when i call string.insert() it simply doesn't add anything to newString. here is the code: string stringToSplit = "s1/s2/s3"; string[] stringArray = stringToSplit.Split('/'); string newString = ""; for(int y = 0;y != stringArray.Length - 1;y++) { newString.Insert(newString.Length,stringArray[y].ToString()); }

Answers (6)
Next Recommended Forum