以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  IndexOf函数的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=39212)

--  作者:yuyijun2
--  发布时间:2013/8/18 21:39:00
--  IndexOf函数的问题

可以从指定有回车的位置开始,删除指定个数的字符吗?如果可以下面的函数应该怎么写

IndexOf("回车符",10)


--  作者:有点甜
--  发布时间:2013/8/18 21:47:00
--  
 执行下面的代码便可

Dim str As String = "xxxxxx" & vbcrlf & "123456"
msgbox(str)
Dim idx As Integer = str.IndexOf(vbcrlf)
If idx > -1 Then
    str = str.SubString(0, idx) & str.SubString(idx+2+3) \'删除3个
End If
msgbox(str)