+ Reply to Thread
Results 1 to 2 of 2

Thread: prevent end of string '\n' to escape

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    13

    prevent end of string '\n' to escape

    I have Windows Forms UI, that allows me to enter format for string formatting in TextBox, like:

    Enter result format: {sku}:{value} \n

    Problem is, that \n is getting escaped, so result format string in debug view looks like:

    {sku}:{value} \\n
    And that produces \n instead of line break in result.

    So question is, how to prevent this, or how to remove escaping before using in StringBuilder.AppendFormat()

  2. #2
    Junior Member
    Join Date
    Jun 2012
    Posts
    14
    Probably, what you want to do is to use the string.Replace(@"\n", "\n") method.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts