Jump to content
Sign in to follow this  
torels

string difference

Recommended Posts

torels

hi there...

I was trying to find a way to detect differences in strings...

ex:

string1 --> ababab

string2 --> ababbb

(the difference is the b in the 5 position)

but I can't figure it out

any suggestions ?

ps. I need to use the function on 2 lists of drives

thanks in advance


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites
Jos

When its a matter of detecting 2 equal length strings and matching the same positions its quite easy. Just create a for-next loop comparing each position:

$s1 = "ababab"
$s2 = "ababbb"
For $x = 1 To StringLen($s1)
    If StringMid($s1,$x,1) <> StringMid($s2,$x,1) Then
        ConsoleWrite("There is a mismatch at position:" & $x & @CRLF)
    EndIf
Next

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
torels

thanks Jos! :P


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.