Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exploding a string into characters 1

Status
Not open for further replies.

JazzLeg

Programmer
Aug 22, 2002
63
GB
Hi,
I have string which i would like to break into individual characters stored in an array,

e.g strChar = info

arrayChar(0) = i
arrayChar(0) = n
arrayChar(0) = f
arrayChar(0) = o

Also, does anyone know how to format strings into upper or lower case?

Thanks
 
Code:
Dim arrayChar()
Dim strChar

strChar = "info"

ReDim arrayChar(Len(strChar))
For idx = 1 to UBound(arrayChar)
   arrayChar(idx) = Mid(strChar,idx,1)
Next

For idx = 1 To UBound(arrayChar)
   MsgBox ("Character " & idx & " = " & arrayChar(idx))
Next

For upper and lower case you use the LCase and UCase functions. Ex:
Code:
MyStr = LCase("AaBbCc")
Code:
   'MyStr is now "aabbcc"
Code:
MyStr = UCase("AaBbCc")
Code:
   'MyStr is now "AABBCC"



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top