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 8676723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:16:13+00:00 2026-06-12T20:16:13+00:00

I copied and pasted a certain source code into my program with a text

  • 0

I copied and pasted a certain source code into my program with a text editor. I basically need to confirm that the source code begins with “int main()” so I went ahead and compared line with “int main()” but the comparison always returned false.

I decided to strip the string into characters and found something weird.

enter image description here

so string line has “int main()” passed inside it which is the text that has been pasted inside the text editor. You would think a and b would have the same characters, but they don’t:

enter image description here

I’m honestly not sure where is that quotation mark in the beginning coming from. The original string didn’t contain it, the debugger doesn’t show it (It would display “\”int main()\”” otherwise). What is happening here?

Edit: I tried line = line.Trim(). Still that character is not gone. Apparently it’s some special unicode character for Zero width no-break space. How can I remove this from my string?

  • 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-06-12T20:16:14+00:00Added an answer on June 12, 2026 at 8:16 pm

    I’ve found the solution:

    private readonly string BYTE_ORDER_MARK_UTF8 = Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble());
    
    ...
    
    if (line.StartsWith(BYTE_ORDER_MARK_UTF8))
                    line = line.Remove(0, BYTE_ORDER_MARK_UTF8.Length);
    

    That was bizzare…

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

Sidebar

Related Questions

I'm working on some doc file, that when copied and pasted into a text
I just copied/pasted this code from the apple dev libary into xcode, and xcode
The complete code is copied and pasted below. I am new to javascript and
I have about 40 'themes' that have each been copied and pasted from a
I have the following bash code, which is copied and pasted from bash cookbook
I'm running VS2010 Pro SP1 (10.0.40219.1). I copied/pasted a folder into my solution's directory
I have PDF papers copied/pasted into TXT as input and I want to build
I have copied and pasted some debugging information into an Excel sheet. However, it
I copied and pasted the example YouTube api code for browser-based uploading to my
I've written some code that I think should be failing under certain conditions, but

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.