vb操作一段文字
有文字
aaaa
bbbb
cccc
怎么样操作得出txt="aaaa bbbb"
[解决办法]
Private Sub Command1_Click() '在Form中做个按键,按一下
Dim iStr As String, i As Integer
' 只取TextBox中前两行:
i = InStr(1, Text1.Text, vbCr) '取得首行位址
i = InStr(i + 2, Text1.Text, vbCr) '取得次行位址
iStr = Left(Text1.Text, i - 1) '取得双行字串,并去除vbCr
iStr = Replace(iStr, vbCrLf, " ") '替换vbCrLf为Space
End Sub