java - How do I get only integers from a string? -


this question has answer here:

i have text field can enter string.

but need return integer using string.

i know how convert strings integers, how separate letters & punctuation string leaves numbers?

try code:

string str = "a1?2.33/4tyz.7!8x"; str = str.replaceall("\\d", ""); 

now str contain "1233478"


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -