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: B4X: SB.Append("Hello").Append(CRLF).Append("World").Append(CRLF).Append("!") With the AppendNewLine method, the above would be shortened to this: B4X: SB.AppendNewLine("Hello").AppendNewLine("World").AppendNewLine("!") And would still output: B4X: Hello World !
It would be helpful if the StringBuilder had a method that would add a new line automatically. Current Way: B4X: SB.Append("Hello").Append(CRLF).Append("World").Append(CRLF).Append("!") With the AppendNewLine method, the above would be shortened to this: B4X: SB.AppendNewLine("Hello").AppendNewLine("World").AppendNewLine("!") And would still output: B4X: Hello World !
somed3v3loper Well-Known Member Licensed User Longtime User Jul 29, 2019 #2 For now try something like this B4X: 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 B4X: 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: B4X: Dim s As String = $"Hello World !"$