Click here to Skip to main content
15,885,278 members
Articles / Programming Languages / Visual Basic

Compare Two Strings with charater

Rate me:
Please Sign up or sign in to vote.
3.00/5 (2 votes)
3 Oct 2012CPOL 10.3K  
Hi,I have 2 textboxes where the user enters texts of same length. I need to do a char by char comparison. For this, i used Chars(i). Now, i have been trying to highlight the differences at the string index which is different. I am not able to figure a way out for that.for...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
8 Oct 2012Akinmade Bond
Try modifying this to what you want...First, add reference to the namespace Microsoft.VisualBasicthis, allows Strings.Mid to be available.using Microsoft.VisualBasic;string First = "Hello"; string Test = "Wello"; int unMatch = 0; int Place =...
Please Sign up or sign in to vote.
8 Oct 2012Thomas Daniels
Try this:C#:List unequalPositions = new List(); string str1 = "HELLO"; string str2 = "WELLM"; for (int i = 0; i < str1.Length; i++) { if (str1[i] != str2[i]) { ...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions