Languages
[Edit]
EN

C# / .NET - split string by space character

0 points
Created by:
Zeeshan-Peel
850

In this article, we would like to show you how to split string by space character in C#.

Quick solution:

Note: 

The regular expression " +" is equivalent to "[ ]+".

 

1. C# simple split by space char

Edit

Output:

2. C# split by space regex

Edit

Output:

3. C# split by space regex once or more

Edit

Output:

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.

C# / .NET - String (popular problems)

C# / .NET - split string by space character
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