Forum,
I have a String like 'ABC111'. i need to spilt into two strings based on numeric and non numeric chars. Is there any function useful for this.
Can any one help me.
Any String function to split the string into two substrings
Moderators: chulett, rschirm, roy
The good news is that there are quite a few functions available for you to use, ranging from ALPHA, FMT through ICONV/OCONV and substring.
The method you choose really depends on what you want to do. If your string always has the format {n-characters}{n-integers} then you can do something more efficient than if they were mixed.
Will remove all numbers from the string. If your data allows it, then
will give you the numeric portion. I like to use the FMT function but don't have the codes available to show you (no BASIC manual on this PC)
The method you choose really depends on what you want to do. If your string always has the format {n-characters}{n-integers} then you can do something more efficient than if they were mixed.
Code: Select all
TextString = CONVERT('0123456789','',InString)
Code: Select all
NumbersString = InString[LEN(TextString)+1,9999]
-
- Participant
- Posts: 232
- Joined: Sat May 07, 2005 2:49 pm
- Location: USA
Hi Balaid,
Like Arndw rightly pointed out, there are a lot of ways you can achieve your goal.
Here is one using Oconv
For Extracting Numbers
For Extracting Characters
Like Arndw rightly pointed out, there are a lot of ways you can achieve your goal.
Here is one using Oconv
For Extracting Numbers
Code: Select all
X = Oconv(IN.INPUTSTRING,"MCN")
Code: Select all
X = Oconv(IN.INPUTSTRING,"MCA")
Thanks,
Naveen
Naveen