Is there any code that is able to split a string based on given symbols, to determine the count of the sub strings, instead of using multiple splits?
e.g.
a [b] # c
a
b
c
This is the string [This is the bracketed string] # This is the string after, hash
in the above case, splitting by # and
sub strings:
This is the string
This is the bracketed string
This is the string after, hash
System.Text.RegularExpressions.Regex.Split(str_s,“[^\w\s]+,”).Where(Function(s) not String.IsNullOrWhiteSpace(s)).ToArray()
the above code splits all special characters, which results in the below, which is not correct
This is the string
This is the bracketed string
This is the string after
hash