Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java: the method to strip a string to an array at space?

Tags:

java

string

Just a blackout, I want the String "hello hallo tjena hej tere" to an array broken at space.

like image 970
hhh Avatar asked Dec 30 '25 19:12

hhh


1 Answers

"hello hallo tjena hej tere".split(" ");

Note that the argument to the split method is a regular expression. See the documentation for the method here.

like image 178
Syntactic Avatar answered Jan 01 '26 09:01

Syntactic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!