Connecting Tech Pros Worldwide Forums | Help | Site Map

C# string comparison tool

Newbie
 
Join Date: Sep 2008
Posts: 1
#1: Sep 8 '08
Does anyone have any source of a program that will compare two strings pasted to a text box? I'm interesting in writing a small program that I can simply paste some text into two edit boxes (mutlti-line edit) and then do a comparison on the contents. It should be fairly straightforward to write, but if something already exists in sample format (or somthing similar) I might as well not re-invent the wheel.

Thanks,
Byron Douglas
Atlanta

balabaster's Avatar
Moderator
 
Join Date: Mar 2007
Location: Canada
Posts: 757
#2: Sep 8 '08

re: C# string comparison tool


Um can you be a little more specific when you say compare...?

For instance:

MessageBox.Show(a.Text == b.Text);

This will return true if they're the same, or false if they're not. I imagine you were looking for something a little more complex than "do they match?" What type of comparison do you need? Is one higher than the other alphabetically? Do you wish to do a value comparison, i.e. which has the higher HEX value? There's so many ways to interpret the word "compare" that without more detail there's not much that we can provide...
joedeene's Avatar
Site Addict
 
Join Date: Jul 2008
Location: US of A
Posts: 587
#3: Sep 8 '08

re: C# string comparison tool


Quote:

Originally Posted by tbyrondouglas

Does anyone have any source of a program that will compare two strings pasted to a text box? I'm interesting in writing a small program that I can simply paste some text into two edit boxes (mutlti-line edit) and then do a comparison on the contents. It should be fairly straightforward to write, but if something already exists in sample format (or somthing similar) I might as well not re-invent the wheel.

Thanks,
Byron Douglas
Atlanta

hey bud, we dont do source codes for you, or other members here at bytes.com, i dont think we point to full source codes either, but i mean if you are working on this project and would like us to throw you a few hints or corrections on a *Code Sample* of a small section of the project with *specific* questions, then we can help you.

joedeene
Reply