Using StrReverse Funtion
strText = "QTP Sreenu Blog"
strRevText = StrReverse(strText)
MsgBox strRevText
strRevText = StrReverse(strText)
MsgBox strRevText
Without using StrReverse function (Using Len and Mid
functions)
strText = "QTP Sreenu Blog"
iLen = Len(strText)
For i=iLen to 1 Step -1
strChar = Mid(strText,i,1) 'Retrieving each character from the end of string
strRevText = strRevText & strChar
Next
MsgBox strRevText
Without using any built-in functions
strText = "QTP Sreenu Blog"
Set oRegExp = New RegExp
oRegExp.Pattern = "\d|\D|\s|\S|\t|\w|\W" 'This pattern matches with any character
oRegExp.Global = True
Set oItems = oRegExp.Execute(strText)
For i=0 To oItems.Count-1
strRevText = oItems(i) & strRevText
Next
For loop above can also be written as below
For i=oItems.Count-1 To 0 Step -1
strRevText = strRevText & oItems(i)
Next
MsgBox strRevText
iLen = Len(strText)
For i=iLen to 1 Step -1
strChar = Mid(strText,i,1) 'Retrieving each character from the end of string
strRevText = strRevText & strChar
Next
MsgBox strRevText
Without using any built-in functions
strText = "QTP Sreenu Blog"
Set oRegExp = New RegExp
oRegExp.Pattern = "\d|\D|\s|\S|\t|\w|\W" 'This pattern matches with any character
oRegExp.Global = True
Set oItems = oRegExp.Execute(strText)
For i=0 To oItems.Count-1
strRevText = oItems(i) & strRevText
Next
For loop above can also be written as below
For i=oItems.Count-1 To 0 Step -1
strRevText = strRevText & oItems(i)
Next
MsgBox strRevText
No comments:
Post a Comment