MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/9h404p/java_11_string_api_updates/e68z4pt/?context=9999
r/java • u/pivovarit • Sep 19 '18
52 comments sorted by
View all comments
55
Holy shit isBlank should have existed long ago. Strip though is just replace without parameters
2 u/dpash Sep 19 '18 Strip though is just replace without parametersWhat do you mean by that? -2 u/TheRedmanCometh Sep 19 '18 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
2
Strip though is just replace without parameters
What do you mean by that?
-2 u/TheRedmanCometh Sep 19 '18 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
-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
Well shit I guess that should've been obvious
55
u/TheRedmanCometh Sep 19 '18
Holy shit isBlank should have existed long ago. Strip though is just replace without parameters