java non-breajubg soace удалить
string.replaceAll("(^\\h*)|(\\h*$)","")
Annoying Antelope
string.replaceAll("(^\\h*)|(\\h*$)","")
string.replaceAll("\\p{Z}","");