MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/9h404p/java_11_string_api_updates/e68z2mb/?context=3
r/java • u/pivovarit • Sep 19 '18
52 comments sorted by
View all comments
Show parent comments
-2
I mean it's essentially String.replace(" ") and it should be called stripWhitespace or stripSpaces
17 u/dpash Sep 19 '18 edited Sep 19 '18 Space is not the only whitespace character, so no, it's nothing like String.replace(" ", "")Also, .strip() doesn't remove all whitespace, only those at the beginning and end of the string. It's a correctly implemented .trim() 0 u/TheRedmanCometh Sep 19 '18 All other whitespace chars I know of are just unrendered unicode shit. Can you elaborate? Not trying to be dickish I'm sincerely interested 3 u/amackenz2048 Sep 19 '18 Tab? 2 u/TheRedmanCometh Sep 19 '18 Well shit I guess that should've been obvious
17
Space is not the only whitespace character, so no, it's nothing like String.replace(" ", "")
String.replace(" ", "")
Also, .strip() doesn't remove all whitespace, only those at the beginning and end of the string. It's a correctly implemented .trim()
.strip()
.trim()
0 u/TheRedmanCometh Sep 19 '18 All other whitespace chars I know of are just unrendered unicode shit. Can you elaborate? Not trying to be dickish I'm sincerely interested 3 u/amackenz2048 Sep 19 '18 Tab? 2 u/TheRedmanCometh Sep 19 '18 Well shit I guess that should've been obvious
0
All other whitespace chars I know of are just unrendered unicode shit. Can you elaborate? Not trying to be dickish I'm sincerely interested
3 u/amackenz2048 Sep 19 '18 Tab? 2 u/TheRedmanCometh Sep 19 '18 Well shit I guess that should've been obvious
3
Tab?
2 u/TheRedmanCometh Sep 19 '18 Well shit I guess that should've been obvious
2
Well shit I guess that should've been obvious
-2
u/TheRedmanCometh Sep 19 '18
I mean it's essentially String.replace(" ") and it should be called stripWhitespace or stripSpaces