473,569 Members | 2,880 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Comparing two strings and returning the differences.

Hello,

I am looking for a routine that would compare the following:

sTest1 = "This is a test"
sTest2 = "This is a long test"

and return the differences between the two:

long

Thanks,
Rob Panosh
Nov 20 '05 #1
9 3033
Cor
Hi Rob,

You mean this

Dim stringLenghtDif ference = sTest1.length - sTest2.length

Or do you mean something else?

Cor

"> I am looking for a routine that would compare the following:

sTest1 = "This is a test"
sTest2 = "This is a long test"

and return the differences between the two:

Nov 20 '05 #2
"Rob Panosh" <ro************ ************@as dsoftadfdware.c om>
schrieb
I am looking for a routine that would compare the following:

sTest1 = "This is a test"
sTest2 = "This is a long test"

and return the differences between the two:

long

"This is test a test"
"This is a test a"

What is the difference between these? What I intend to say is that the logic
behind is not easy to implement. Maybe somebody else has got a link for you.

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
Check this out!
http://www.merriampark.com/ld.htm

I have no ideea if NET have implemented such algorithm

--
Ceers,
Crirus

------------------------------
If work were a good thing, the boss would take it all from you

------------------------------

"Rob Panosh" <ro************ ************@as dsoftadfdware.c om> wrote in
message news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hello,

I am looking for a routine that would compare the following:

sTest1 = "This is a test"
sTest2 = "This is a long test"

and return the differences between the two:

long

Thanks,
Rob Panosh

Nov 20 '05 #4
* "Rob Panosh" <ro************ ************@as dsoftadfdware.c om> scripsit:
I am looking for a routine that would compare the following:

sTest1 = "This is a test"
sTest2 = "This is a long test"

and return the differences between the two:


Something like the "WinDiff" tool does?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #5
Herfried,
Speaking of WinDiff.

I want a "nicer" WinDiff, something like the Diff out of Visual Source Safe,
that functions as an Add-In to VS.NET.

The C source to WinDiff can installed with VS.NET. I was playing with that a
couple months ago, it is very C. Which means that it is not easily ported to
C++, C#, much less VB.NET.

Just a thought
Jay

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bp******** *****@ID-208219.news.uni-berlin.de...
* "Rob Panosh" <ro************ ************@as dsoftadfdware.c om> scripsit:
I am looking for a routine that would compare the following:

sTest1 = "This is a test"
sTest2 = "This is a long test"

and return the differences between the two:


Something like the "WinDiff" tool does?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>

Nov 20 '05 #6
* "Jay B. Harlow [MVP - Outlook]" <Ja********@ema il.msn.com> scripsit:
Speaking of WinDiff.

I want a "nicer" WinDiff, something like the Diff out of Visual Source Safe,
that functions as an Add-In to VS.NET.


Parts of WinDiff's GUI look as if they were taken from 16-bit Windows.

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #7
Herfried,
I seem to remember that it was included with the Win 3.1 SDK (16-bit). I
don't remember when the source first showed up.

Jay

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bp******** *****@ID-208219.news.uni-berlin.de...
* "Jay B. Harlow [MVP - Outlook]" <Ja********@ema il.msn.com> scripsit:
Speaking of WinDiff.

I want a "nicer" WinDiff, something like the Diff out of Visual Source Safe, that functions as an Add-In to VS.NET.


Parts of WinDiff's GUI look as if they were taken from 16-bit Windows.

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>

Nov 20 '05 #8
yes ..., and like Visual Source Safe shows the differences between to files.

I want to be able to call a routine in my source so I can display the
differences.

Rob
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bp******** *****@ID-208219.news.uni-berlin.de...
* "Rob Panosh" <ro************ ************@as dsoftadfdware.c om> scripsit:
I am looking for a routine that would compare the following:

sTest1 = "This is a test"
sTest2 = "This is a long test"

and return the differences between the two:


Something like the "WinDiff" tool does?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>

Nov 20 '05 #9
clr
> yes ..., and like Visual Source Safe shows the differences between to
files.

When I use differences in Visual Source Safe, only the text lines that are
different are identified. Am I missing an option setting that will identify
the different content within a specific line?

Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1424
by: matt cook | last post by:
The concept - a HTML file changes regularly. However, only certain parts of the page change. I want to find a regular expression that describes that changed area. Can anyone here think of a rough way to go about this? I'm thinking grab the page once a day, put it in a table with a date stamp, and then do something.
5
7586
by: beliavsky | last post by:
By mistake I coded something like print ("1" > 1) and got the result "True". Comparing an integer and a string seems meaningless to me, and I would prefer to have an exception thrown. Can someone explain why Python allows comparisons between integers and strings, and how it handles those cases? Why is "1" > 1? Pychecker does not warn...
5
3391
by: Dennieku | last post by:
Does anybody have an idea how to compare two strings? What I want to know is the percentage of the differences between the strings Thx, Dennieku
5
2409
by: Curtis Gilchrist | last post by:
I am required to read in records from a file and store them in descending order by an customer number, which is a c-style string of length 5. I am storing these records in a linked list. My problem is in comparing the customer number I just read in with those in the list. I'm not sure how to go about comparing c-style strings for greater...
4
10522
by: agent349 | last post by:
First off, I know arrays can't be compared directly (ie: if (arrary1 == array2)). However, I've been trying to compare two arrays using pointers with no success. Basically, I want to take three sets of character strings from the user. Then I want to run through each element and compare the two strings. If they match I print they match... I'm...
88
21965
by: William Krick | last post by:
I'm currently evaluating two implementations of a case insensitive string comparison function to replace the non-ANSI stricmp(). Both of the implementations below seem to work fine but I'm wondering if one is better than the other or if there is some sort of hybrid of the two that would be superior. IMPLEMENTATION 1: #ifndef...
19
2633
by: Dennis | last post by:
I have a public variable in a class of type color declared as follows: public mycolor as color = color.Empty I want to check to see if the user has specified a color like; if mycolor = Color.Empty then..... or if mycolor is Color.Empty then .......
20
2126
by: Bill Pursell | last post by:
This question involves code relying on mmap, and thus is not maximally portable. Undoubtedly, many will complain that my question is not topical... I have two pointers, the first of which is mmapped to a single page. I want to determine if the second is on the page. I'd like to do: #include...
2
3373
by: Pugi! | last post by:
hi, I am using this code for checking wether a value (form input) is an integer and wether it is smaller than a given maximum and greater then a given minimum value: function checkInteger(&$value, $checks) { $err = ''; if (!is_numeric($value) || (floatval($value) != intval($value))) { $err .= 'Input must be an integer. ';
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7619
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.