KP Automation

Systems. Solutions. Services.

  • Welcome
  • Kevin Pinto
  • Blog

How to encode double quotes and newlines inside a C# string

19. September 2008 · Write a comment · Categories: C#, double quotes, line break, newline, string

It turns out that this is not as easy as it seems. The syntax is kludgy. I found the answer on Gus Perez’s blog

Imagine that you want this literal string in your C# code:

108P091G-000

Then you have to code this in C# as:

string sInputData = @”
108P091G-000

Ugh!

Recent Posts

  • passed.pw: Generate passwords friendly to smartphones and mobile devices
  • Using QlikView Desktop Client, Qlik Sense and other Windows-only software on a Mac
  • Visualization of how fast Ebola spreads
  • Good advice on writing hyperlinks
  • QlikView training using QlikView 11 for Developers

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Archives

  • January 2016
  • May 2015
  • October 2014
  • March 2014
  • February 2014
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • November 2010
  • August 2009
  • April 2009
  • November 2008
  • September 2008

Categories

  • .net
  • asp.net
  • Business Intelligence
  • C#
  • cvs
  • double quotes
  • Encryption
  • escape
  • html
  • intelliparse
  • line break
  • mount point
  • newline
  • ntfs
  • openid stackoverflow
  • QlikView
  • string
  • Technology
  • truecrypt
  • Uncategorized
  • vista
  • visual web developer
  • WordPress
  • xml
© 2023 KP Automation. All rights reserved.
Design by picomol. Powered by WordPress.