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

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -