How to remove white space "U+3164"?

Viewed 117

My code is checking the blank/empty string using "".isNullOrBlank().

But I faced a very weird case.

ㅤㅤㅤㅤㅤㅤ

Did you see this white spaces? If you check this using .isNullOrBlank(), it returns false.

I tried to remove it using below code but I couldn't...

println("       ㅤㅤㅤㅤㅤㅤ       ".replace("\\t+".toRegex(), "").isNullOrBlank())
println("       ㅤㅤㅤㅤㅤㅤ       ".replace("\\n+".toRegex(), "").isNullOrBlank())
println("       ㅤㅤㅤㅤㅤㅤ       ".replace("\\r+".toRegex(), "").isNullOrBlank())
println("       ㅤㅤㅤㅤㅤㅤ       ".replace("\\s+".toRegex(), "").isNullOrBlank())

This string is consist of white spaces and "U+3164".

So if I use below code, it prints "true"

println("       ㅤㅤㅤㅤㅤㅤ       ".replace("\u3164", "").isNullOrBlank()) // prints true

But I don't like this.

I don't know about the unicode world well. Maybe there are a lot of similar unicodes... I want to cover all case...

How can I do this?

0 Answers
Related