- I will create a parametric structure
- I will take after each '#' with its extension.
- For example here I need to get two texts after #
Asked
Active
Viewed 112 times
0

Markus Meyer
- 3,327
- 10
- 22
- 35

Metehan Simsek
- 13
- 3
-
1Please post text as *text*, not as image – Hans Kesting Oct 05 '22 at 16:20
1 Answers
1
string text = "#sdvdsv0..-+mk?/!|°¬ *$%&()oO###sdfv684618awer6816";
string[] results = Regex.Split(text, "#+").Where(s => s != String.Empty).ToArray<string>();
Full example on a .net 6.0 console:
using System.Text.RegularExpressions;
string text = "#sdvdsv0..-+mk?/!|°¬ *$%&()oO###sdfv684618awer6816";
string[] results = Regex.Split(text, "#+").Where(s => s != String.Empty).ToArray<string>();
foreach (var x in results)
{
Console.WriteLine(x);
}
Output:
sdvdsv0..-+mk?/!|°¬ *$%&()oO
sdfv684618awer6816
Use "#" to match only a single # character.
Use "#+" to match at least once with the # character

joseph l
- 51
- 7