MsgBox Len(str)
str1 = "v"
MsgBox Len(str1)
str2 = "venu"
MsgBox InStr(1,str2, "3", 1)
str = "venu"
For i=Len(str) To 1 Step -1
str3 = str3 & Mid(str, i, 1)
Next
MsgBox str3
MsgBox StrReverse("hi")
MsgBox "lower to upper"
MsgBox Asc("a") & "/" & Asc("z")
str1= "Venu Gopi"
str2 = ""
For i = 1 To Len(str1)
char = Mid (str1, i,1)
If Asc(char)>=97 and Asc(char)<=122 Then
str2 = str2 & UCase(char)
Else
str2 = str2 & LCase(char)
End If
Next
MsgBox str2
MsgBox "Regular Expression.."
str1 = "Venu GOpala krishna GOPI"
str2 =""
Set reg = New RegExp
reg.pattern ="[a-z]"
reg.global = True
reg.ignoreCase = False
For i = 1 To Len(str1)
c = Mid(str1, i, 1)
flag = reg.test(c)
If flag Then
str2 = str2 & UCase(c)
Else
str2 = str2 & LCase(c)
End If
Next
MsgBox str2
--------------------------------
Version:0.9 StartHTML:00000107 EndHTML:00004204 EndFragment:00004164 EndFragment:00000000 ''Reverse An Array
a = Array(1,2,3,5,8,9,10,11)
printArray(a)
Sub printArray(arrData)
For i =0 To UBound(arrData)
s = s & arrData(i) & "-"
Next
MsgBox s
End Sub
x = UBound(a)
For i = 0 To x/2
temp = a(i)
a(i) = a(x)
a(x) = temp
x= x-1
Next
printArray(a)
=====================================
a = Array(2,3,5,1,6,9,12,14,13)
MsgBox "Sorting an array"
printArray(a)
x = UBound(a)
For i= 0 To x-1
For j=0 To i
If a(j)>a(j+1) Then
temp = a(j)
a(j) = a(j+1)
a(j+1) = temp
End If
Next
Next
printArray(a)
Sub printArray(arrData)
For i =0 To UBound(a)
s = s & a(i) & "-"
Next
MsgBox s
End Sub
str1 = "v"
MsgBox Len(str1)
str2 = "venu"
MsgBox InStr(1,str2, "3", 1)
str = "venu"
For i=Len(str) To 1 Step -1
str3 = str3 & Mid(str, i, 1)
Next
MsgBox str3
MsgBox StrReverse("hi")
MsgBox "lower to upper"
MsgBox Asc("a") & "/" & Asc("z")
str1= "Venu Gopi"
str2 = ""
For i = 1 To Len(str1)
char = Mid (str1, i,1)
If Asc(char)>=97 and Asc(char)<=122 Then
str2 = str2 & UCase(char)
Else
str2 = str2 & LCase(char)
End If
Next
MsgBox str2
MsgBox "Regular Expression.."
str1 = "Venu GOpala krishna GOPI"
str2 =""
Set reg = New RegExp
reg.pattern ="[a-z]"
reg.global = True
reg.ignoreCase = False
For i = 1 To Len(str1)
c = Mid(str1, i, 1)
flag = reg.test(c)
If flag Then
str2 = str2 & UCase(c)
Else
str2 = str2 & LCase(c)
End If
Next
MsgBox str2
--------------------------------
Version:0.9 StartHTML:00000107 EndHTML:00004204 EndFragment:00004164 EndFragment:00000000 ''Reverse An Array
a = Array(1,2,3,5,8,9,10,11)
printArray(a)
Sub printArray(arrData)
For i =0 To UBound(arrData)
s = s & arrData(i) & "-"
Next
MsgBox s
End Sub
x = UBound(a)
For i = 0 To x/2
temp = a(i)
a(i) = a(x)
a(x) = temp
x= x-1
Next
printArray(a)
=====================================
a = Array(2,3,5,1,6,9,12,14,13)
MsgBox "Sorting an array"
printArray(a)
x = UBound(a)
For i= 0 To x-1
For j=0 To i
If a(j)>a(j+1) Then
temp = a(j)
a(j) = a(j+1)
a(j+1) = temp
End If
Next
Next
printArray(a)
Sub printArray(arrData)
For i =0 To UBound(a)
s = s & a(i) & "-"
Next
MsgBox s
End Sub
No comments:
Post a Comment