Thanks Nocholas and Morten.
I am aware of this method. I was looking for any other efficient way to do
this. Your responses confirmed that there is no better way to do this than
the one you guys suggested.
I was looking whether there is a way we can use FC (DOS file compare) to do
this or some other alternative.
Anyhow thank you once again for your responses.
Sasidhar
"Morten Wennevik" <Mo************@hotmail.com> wrote in message
news:opsnhg32x6klbvpo@pbn_computer...
Hi Sasidhar
This will do it (hope I'm not doing your homework :) and if so, make sure
you understand the code fully :P)
ArrayList list = new ArrayList();
string s = "Hello World";
string t = "Getto Word";
for(int i = 0; i < s.Length; i++)
{
if(i >= t.Length)
list.Add(i);
else if(s[i] != t[i])
list.Add(i);
}
// if you also want virtual positions if s is the shortest string
if(t.Length > s.Length)
{
for(int i = s.Length; i <= t.Length; i++)
list.Add(i);
}
// optional, the list will contain all positions
int[] indices = (int[])list.ToArray(typeof(int));
--
Happy Coding!
Morten Wennevik [C# MVP]