Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Trimming leading zeroes

How to get a decimal from a string after trimming of leading zeros and non-numeric characters.

Labels (2)
5 Replies
Anonymous
Not applicable
Author

Can you give a typical example of the String you want to change?

Anonymous
Not applicable
Author

Let the string be like

000AB1234

001234AB

I need the output as

1234

1234

akumar2301
Specialist II
Specialist II

Integer.parseInt(text.replaceAll("[^0-9]", ""))
Anonymous
Not applicable
Author

I tried Integer.parseInt(input.replaceAll("[^0-9]", "")) in tjavarow

But I'm getting null in my output

manodwhb
Champion II
Champion II

@Matthew , below one should also work.

 

Integer.parseInt(row1.col1.replaceAll("[^\\d.]", ""))