Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a string that can take the following forms:
"1"
"23"
"1 abcdef"
"23 abcdf"
I want to extract the numerical value from the string and then convert it to an int data type (as specified in output DB).
I have tried using the Integer.parseInt, but the job fails since the string contains non-numerical values as well.
Can someone please advise me.
Thanks!
Did you try with the following regex to remove every non-digit characters?
row1.yourField.replaceAll("\D", "")
Thanks for your advise TRF. I overlooked one issue: The string can also take this form:
"1 abcdef 234"
"23 abcdef 567"
I only want to extract the first numbers(1 and 23). If I go head with the mentioned regex I will still be stuck with the digit-characters I don't want.
I tried this but its not working. my string is like this "abc 20mbps"
Thanks its works . If i have to extract mbps from the string "abc 20mbps" , how to do that?
Thanks in advance
We want to create a date variable in numeric format based on this string variable mcdvoice.
no, only mbps....