在此实例中的指定索引位置插入一个指定的 String 实例。[Visual Basic] <Serializable> Public Function Insert( _ ByVal startIndex As Integer, _ ByVal value As String _ ) As String我也刚刚发现。有返回值的。唉。又花了一个小时。
For j = 1 To i - 1 System.Diagnostics.Debug.WriteLine(j * 55) contest.Insert(j * 55, "aa") System.Diagnostics.Debug.WriteLine(contest) Next 假如我输入55个字符后,则i=1,而for循环不能从j=1到-1吧!
"bbb".insert(2,"a") '这样行的,但
我上面的这样就不行,唉。没戏了。
我看是位数不对吧,譬如10个字符的字符串,我将"aa"插到20的位置,可能是不行的!
任何改变的方法都是返回一个新的string
所以应该这样
contest=contest.Insert(j * 55, "aa");
<Serializable>
Public Function Insert( _
ByVal startIndex As Integer, _
ByVal value As String _
) As String我也刚刚发现。有返回值的。唉。又花了一个小时。
System.Diagnostics.Debug.WriteLine(j * 55)
contest.Insert(j * 55, "aa")
System.Diagnostics.Debug.WriteLine(contest)
Next
假如我输入55个字符后,则i=1,而for循环不能从j=1到-1吧!