473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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 3024
Cor
Hi Rob,

You mean this

Dim stringLenghtDifference = 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************************@asdsoftadfdware.com>
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************************@asdsoftadfdware.com> wrote in
message news:%2****************@tk2msftngp13.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************************@asdsoftadfdware.com> 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************************@asdsoftadfdware.com> 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********@email.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********@email.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************************@asdsoftadfdware.com> 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
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...
5
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...
5
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
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...
4
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...
88
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...
19
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 =...
20
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...
2
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.