I want to split the string on the basis of characters and string like (,
.
;
and
or
though
but
etc.).
Original string: "This movie is great. I like the story, acting is nice and direction is perfect but music is not good."
Result:
This movie is great
I like the story
acting is nice
direction is perfect
music is not good
I have tried this.
string test = "This movie is great. I like the story, acting is nice and direction is perfect but music is not good.";
var splittC = Regex.Split(test, ",");
foreach(var a in splittC){
var splittD = Regex.Split(test, ".");
foreach(var b in splittD){
var splittA = Regex.Split(test, "and");
}
}// and so on....
It is taking so much loops.
And if there is no Comma in this string then it will not check other characters. How to solve these problems. Please help.