jppinto
asked on
Convert string to special format
Hello,
I'm trying to convert the value of a textbox to something like this;
XXX XXX XXX XXXXXX
Where the value of the textbox can be numbers or letters, upper or lower case.
Example:
I enter 7m0343834ewrw and I want the result to be 7M0 343 834 EWRW.
How do I format MyTextBox?
thanks,
jppinto
I'm trying to convert the value of a textbox to something like this;
XXX XXX XXX XXXXXX
Where the value of the textbox can be numbers or letters, upper or lower case.
Example:
I enter 7m0343834ewrw and I want the result to be 7M0 343 834 EWRW.
How do I format MyTextBox?
thanks,
jppinto
LEFT(MyTextBox.Text, 3) & " " & MID(MyTextBox.Text,4, 3) & " " & MID(MyTextBox.Text,7, 3) & " " & MID(MyTextBox.Text,10,50)
In VB6...
Dim strInput As String
strInput = UCase(Replace(SomeForm.MyT extBox, " ", ""))
strInput = Trim(Left(strInput, 3) & " " & Mid(strInput, 4, 3) & " " & Mid(strInput, 7, 3) & " " & Right(strInput, 4))
MsgBox strInput
Dim strInput As String
strInput = UCase(Replace(SomeForm.MyT
strInput = Trim(Left(strInput, 3) & " " & Mid(strInput, 4, 3) & " " & Mid(strInput, 7, 3) & " " & Right(strInput, 4))
MsgBox strInput
Need more coffee :)
ASKER
Error:
Public Property Left() As Integer' has no parameters and its return type cannot be indexed.
jppinto
Public Property Left() As Integer' has no parameters and its return type cannot be indexed.
jppinto
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks jpaulino. Now it's working!