Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have requirement where in order to match the names from lookup table to main table, I need to remove spaces from input value.
For ex. Input -"ABC<space><space><space> DGJ"
Lookup value "ABC<space>DGJ"
Some values have 3 spaces between it or some have have 2 spaces between name. How can i eliminate these without using too many replace?
This should work for you.....
row1.columnName.replaceAll(" +", " ")
Hi, and if you want to keep only one space:
row1.columnName.replaceAll("(?<= ) +","")