Remove characters and retain only numbers from string

How do I remove all alphabets and retain only numbers from a string ?? I have made a list in Listview. (CIGARETTE, Rs 2000). I need to REMOVE all alphabets, and retain only numbers, when the Listview Element is selected.

Input String is CIGARETTE, Rs 2000
Output String Required is 2000

You mean you want to take 2000 from this:

Yes, When the ListView Element is selected, Only the NUMBERS should be set to a textbox.text

When I select CIGARETTE, Rs 2000, in the Listview, the Textbox1.text shud become 2000

You can use one of these 2 blocks :

blocks

1 Like

Tried both, dosent work

Make it like this :

2 Likes

Tx. Worked with Index 4

:+1: :smiley: :+1:

i think it worked because numbers and alphabets are separated by space, but try out to retrieve 23 from
2a3a
it works?

if that you have to use the first block of this :

blocks

split at a... but what about 1a4b6c? Can you retrieve 146 from here?

Yes, of course i can

how do you can? Please show with blocks

Does this help you :

but if we don't know the text? e.g. if it is a text box instead of list view?

Actually like that you can also use this block :
text_replace_all

maybe this is better

1 Like

that's amazing. so you can create a procedure with an input and then we can use do result with lots of set variable for all characters not numbers and then resulting that variable.
that solution that you putted now has a problem: there is not abc, is a b c d e, etc. so we need multiple blocks.

have you tried to make like this

Try this:

handles upper and lower case

2 Likes