The string object has several functions that are able to reverse a string-strreverse(), compare a string strcomp(), extract characters from a string-Left(), mid(), right(), UCase(), Lcase() and InStr().
The mid(string, start of string to extract, number of characters) function is used to extract a string inside a given string.
The Left(string, start of string, number of characters) is used to extract charcters from the left portion of a string. The Mid$() functions return a string value compared the Mid() functions returning a variant.
Private Sub Form_Load()
Dim str As String
Dim i As Integer
str = "stringring"
str1 = "ring"
'MsgBox UCase(str)
'MsgBox LCase(str)
'i = InStr(str, str1)
i = InStrRev(str, str1)
'str = Mid(str, 2, 5)
'str = Left(str, 4)
'str = Right(str, 4)
'MsgBox " " & Mid$(str, 2, 5) & vbCrLf & Left(str, 4)
'MsgBox Left(str, 1)
'MsgBox Mid(str1, 3, 1)
End Sub
The mid(string, start of string to extract, number of characters) function is used to extract a string inside a given string.
The Left(string, start of string, number of characters) is used to extract charcters from the left portion of a string. The Mid$() functions return a string value compared the Mid() functions returning a variant.
Private Sub Form_Load()
Dim str As String
Dim i As Integer
str = "stringring"
str1 = "ring"
'MsgBox UCase(str)
'MsgBox LCase(str)
'i = InStr(str, str1)
i = InStrRev(str, str1)
'str = Mid(str, 2, 5)
'str = Left(str, 4)
'str = Right(str, 4)
'MsgBox " " & Mid$(str, 2, 5) & vbCrLf & Left(str, 4)
'MsgBox Left(str, 1)
'MsgBox Mid(str1, 3, 1)
End Sub
No comments:
Post a Comment