vb.net - Parse a string to a specified length (without cutting words) -
I have a long string that I need to parse in the string array that does not exceed 40 characters in length . The difficult part of me is making sure that RJX finds the empty space to make a clean brake between the strings 40 before I do not want to cut words.
Trim the substrings properly as you go:
(? & Lt; sub & gt ;. {1,40}) (?: \ S + | $). (? & Lt; sub & gt ;. {40}) The first one tries for a clean brake, but the second if there is a blindfold to cut it blindly, after this, the substring Available in m.Groups ["sub"]. Capture
.
Comments
Post a Comment