How do I get only letters from a string

Get help using Construct 2

Post » Tue Mar 31, 2015 7:57 pm

Hello,
I have strings like this eg.

123456-NAME-XXX

what i need is to extract only letters (name) between "-" delimiters
any tips?

i can even set string as this:
123456-NAME
or this
123456NAME

and remove only numbers?

Tnx!
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Tue Mar 31, 2015 8:11 pm

Taking the 123456-Name example, the 'Name' can be extracted using "tokenat('123456-Name', 1, '-')"
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,388

Post » Tue Mar 31, 2015 8:22 pm

@briggybros
thanks,
but will this work becouse numbers and letters are random, not allways the same.
i feel it must be with some range from 0-9... but cant find range expression... no?
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Tue Mar 31, 2015 9:00 pm

if the numbers and letters are always separated by a '-', then that expression will always get the second part.
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,388

Post » Tue Mar 31, 2015 9:02 pm

@briggybros

thanks!
iw made it!!!! :)
B
26
S
11
G
2
Posts: 669
Reputation: 5,038


Return to How do I....?

Who is online

Users browsing this forum: DJKeefy, mekonbekon, SputnikCZ and 9 guests