Break line where one of the char is match

Posted by Ishan7 under C# on 1/19/2021 | Points: 10 | Views : 217 | Status : [Member] | Replies : 1
I have a long string, and this string must break at 15 characters in this example.

This must break right here

The character 15 is the letter K, so it returns one character and checks if is { ' ', '.', ',' } If is, break the line in this position, in the example is the position 10.

My code is only working if I use only one character in the equals clause:

char break= ' ';

What am I doing wrong?


Posted by: Roanporter76 on: 2/7/2021 [Member] Starter | Points: 25


Ishan7, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response