私は2つの文字列を持っています
string str1 = "Hello World !"; // the position of W character is 6
string str2 = "peace";
//...
string result = "Hello peace !"; // str2 is written to str1 from position 6
このような機能はありますか?
string result = str1.Rewrite(str2, 6); // (string, position)
この「HelloWorld !」を編集しました 単なる例です。この文字列に「W」文字が含まれているかどうかはわかりません。私が知っているのはstr1
、、、str2
position(int
)だけです。