LWGShane Well-Known Member Licensed User Longtime User Jul 29, 2019 #1 It would be helpful if the StringBuilder had a method that would add a new line automatically. Current Way: Code: Copy SB.Append("Hello").Append(CRLF).Append("World").Append(CRLF).Append("!") With the AppendNewLine method, the above would be shortened to this: Code: Copy SB.AppendNewLine("Hello").AppendNewLine("World").AppendNewLine("!") And would still output: Code: Copy Hello World !
It would be helpful if the StringBuilder had a method that would add a new line automatically. Current Way: Code: Copy SB.Append("Hello").Append(CRLF).Append("World").Append(CRLF).Append("!") With the AppendNewLine method, the above would be shortened to this: Code: Copy SB.AppendNewLine("Hello").AppendNewLine("World").AppendNewLine("!") And would still output: Code: Copy Hello World !
somed3v3loper Well-Known Member Licensed User Longtime User Jul 29, 2019 #2 For now try something like this Code: Copy Public sub AppendNewLine(sb as stringbuilder, text as string) as stringbuilder sb.Append(text) sb.Append(CRLF) return sb End sub
For now try something like this Code: Copy Public sub AppendNewLine(sb as stringbuilder, text as string) as stringbuilder sb.Append(text) sb.Append(CRLF) return sb End sub
Erel B4X founder Staff member Licensed User Longtime User Jul 29, 2019 #3 Or: Code: Copy Dim s As String = $"Hello World !"$