Languages
[Edit]
EN

Java - split string with more than 1 space between words

4 points
Created by:
leila
435

1. Overview

Edit

2. Java split by whitespace regex - \\s+

Edit

Code example: 

Output:

3. Java split by regex - \\s{2,8} - split string from 2 to 8 spaces

Edit

Code example with explanation in comment:

Output:

Alternative titles

  1. Java - how to split string when we have more than 1 space character between words?
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Java - String (popular problems)

Java - how to split string when we have more than 1 space character between words?
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join