Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 875331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:15:07+00:00 2026-05-15T11:15:07+00:00

While searching on how to escape a single quote in String.Format, I found the

  • 0

While searching on how to escape a single quote in String.Format, I found the answer at SO: Escaping single quote in String.Format()

It seems to be different for VB though. I tested it, and indeed C# needs

string s = DateTime.Now.ToString("MMM d \\'yy 'at' H:mmm");

while VB needs

Dim s As String = Now.ToString("MMM d \'yy 'at' H:mmm")

Why does C# need a double backslash, and VB a single backslash? This might be a bit of a silly question to C# users, but while I can read C#, I’m not used to writing it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:15:08+00:00Added an answer on May 15, 2026 at 11:15 am

    In C#, string literals can contain escape sequences such as \n for a new line or \t for a tab or \” for a quote. If you do not need the escaping, you can prefix the literal with @ (eg: @"MMM ...") and get the same string a VB.

    In VB, escaping is never allowed, so there is no need to escape the backslash.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While searching for how to do this, I found some vague discussion about different
While searching for an answer to this question I found this sample code which
While searching the web, I found this code: $apprequest_url =https://graph.facebook.com/ . /apprequests?ids=USERID_1,USERID_2,USERID_3 . &message='INSERT_UT8_STRING_MSG'
While searching a bug in my code today I found a strange thing. When
I'm searching a while for this and I can't found something that works for
While searching for Tutorials on generating random numbers in C I found this topic
I have spent a while searching google for an answer to the following question,
Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetAllowResponseInBrowserHistory(false); While searching for authentication, I found the above two lines written. What
While searching for linq conditional where clause, I found this article , the way
I am currently stumped while searching for an answer, but I have an array

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.