Here's another alternative, not necessarily better or worse:vb.net Code:
Private Function GetStringLengthWithoutLineBreaks(text As String) As Integer Return text.Split(New String() {ControlChars.NewLine, ControlChars.Cr, ControlChars.Lf}, StringSplitOptions.None).Sum(Function(s) s.Length) End Function




Reply With Quote