i have a small problem.
i am working on a keywords string, which comes from different providers (which i have no control over), and they all send the string in a different format.
the keywords in the string could be separated by commas, semicolons, space, or tab.
in one string, only one type of the delimiters is used.
how would you go about of recognizing it?
i was thinking of something like (pseudo code):
string delimiters = { ",",";"," " };
var x = str.split(delimiters[0]).count();
var y = str.split(delimiters[1]).count();
var z = str.split(delimiters[2]).count();
then check which is the largest and use it.
do you have know a better idea ?
Your idea works perfectly but I think a better solution could be create an extension method and return a jagged array in this way:
And then use it like here: