I have a string that has the following format:
string sample = "A, ABC, 1, ACS,,"
As you can see, there are 5 occurences of the ,
character.
I need to remove everything after the 4th occurrence so that the final result will be:
string result = fx(sample, 4);
"A, ABC, 1, ACS"
Is it possible without a foreach
? Thanks in advance.