I want to fill a field with a string of many words. When I have huge words I need a to split the word. If my word is longer than 10 letters I need a space at position 5 of this word.
How do I get the new "myString" with shorter words?
static void Main(string[] args)
{
var myString = "This is my string with some loooooooooooooong words. Please devide meeeeeeeeeeeeeeeeeeeeeeeee";
var myStringSplit = myString.Split();
var query = myStringSplit.Where(x => x.Length > 10).ToList();
foreach (var item in query)
{
item.Insert(5, " ");
}
}
Edit: My expected result: myString = "This is my strin g with some loooo ooooo ooooo ng words. Pleas e devid e meeee eeeee eeeee eeeee eeeee e"
;