Thursday, May 7, 2015

How do i compare two strings and get the difference?

I wont encounter the example you gave since i'm comparing values in an INI file. Either one of the string will be empty or they will vary slightly.

for example

1)

s1 = "IgnintionStatus =1"

s2 = "IgnitionStatus = 2"

if i can somehow extract the difference between s1 and s2 which 1,2 that would be great.

example 2)

s1 = " IgnintionStatus =1"

s2= ""

strDiff =  "IgnintionStatus =1"

These are the only two examples i am concerned about, thanks.

No comments:

Post a Comment