Java String to remove all spaces in a string

// \ s matches spaces, tabs, page breaks and other whitespace characters escape

String newFileName = fileName.replaceAll("\\s*", "");

Forget their fear, record, thank you watch!

Published 45 original articles · won praise 6 · views 2020

Guess you like

Origin blog.csdn.net/qq_22583191/article/details/104229230