Wish [Wish] StringBuilder new method: AppendNewLine

Discussion in 'Bugs & wishlist' started by ShaneG30, Jul 29, 2019.

  1. ShaneG30

    ShaneG30 Well-Known Member Licensed User

    It would be helpful if the StringBuilder had a method that would add a new line automatically.

    Current Way:
    Code:
    SB.Append("Hello").Append(CRLF).Append("World").Append(CRLF).Append("!")
    With the AppendNewLine method, the above would be shortened to this:
    Code:
    SB.AppendNewLine("Hello").AppendNewLine("World").AppendNewLine("!")
    And would still output:

    Code:
    Hello
    World
    !
     
  2. somed3v3loper

    somed3v3loper Well-Known Member Licensed User

    For now try something like this

    Code:
    Public sub AppendNewLine(sb as stringbuilder, text as stringas stringbuilder

        sb.Append(text)

        sb.Append(
    CRLF)

        
    return sb

    End sub
     
    Kiffi likes this.
  3. Erel

    Erel Administrator Staff Member Licensed User

    Or:
    Code:
    Dim s As String = $"Hello
    World
    !"$
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice