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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:20:48+00:00 2026-06-11T16:20:48+00:00

In order to debug an issue in my code, I have declared the following

  • 0

In order to debug an issue in my code, I have declared the following two strings, assuming they would be equivalent:

String print = "8A9B485ECDC56B6E0FD023D6994A57EEC49B0717";
String newPrint = thumbprint.Trim().Replace(" ", "").ToUpper();

I discovered they are not. Great, this is the source of my issue. However, I’m checking things in the immediate window (on the line following the declarations) and don’t understand what is happening. Here is the output:

print
"8A9B485ECDC56B6E0FD023D6994A57EEC49B0717"
newPrint
"‎8A9B485ECDC56B6E0FD023D6994A57EEC49B0717"
String.Compare(print, newPrint);
0
print == newPrint
false
print.Equals(newPrint)
false

huh? Why aren’t they equal?

edit:

I need to use ‘thumbprint’ as the base. It’s a user entered string. I’m just using ‘newPrint’ as a temporary variable to hold the trimmed/uppered value. print is the expected outcome.

  • 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-11T16:20:49+00:00Added an answer on June 11, 2026 at 4:20 pm

    Indeed, they are not equivalent. I copied the two values and newPrint has a length of 41 whereas print has a length of 40. The first character of newPrint is a character with the ASCII value 14. Interesstingly, this has been transfered from your immediate window to SO to my LINQPad.

    print.Length
    40
    newPrint.Length
    41
    (sbyte)print[0]
    56
    (sbyte)newPrint[0]
    14
    

    That actually has nothing to do with your Trim and Replace calls but with the fact that you are using thumbprint instead of print as the base. I can only assume that thumbprint contains that additional character. Where it comes from I don’t know. If you would change your second line to use print instead of thumbprint you would get the result you expect.

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

Sidebar

Related Questions

In order to debug an issue with our usage of Hibernate, I would like
In order to debug I would like to dump certain variables on to my
Sometimes I have come across this issue that whenever I change the order of
I have a weird issue with Excel calculation order - dependent cell gets calculated
So I have the following WORKING virtualhost: <VirtualHost 192.168.128.20:80> ServerName euclid.domain.tld #LogLevel debug ErrorLog
In order to develop and debug mobile and tablet applications, I'd like to be
Order by descending is not working on LINQ to Entity In the following Query
Order deny,allow deny from all allow from xx.xx.x.xx RewriteRule . - [F] I have
in order to recover data from server I use XMLHttpRequest and my code is
Issue We are using config transforms inside our solution. For example: Debug, Test, Staging,

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.