Compare 2 columns in arrays to Par

Question

Hello all! I am new to powershell and I had a question. I am trying to parse two Anagrams. I have split both strings into 2 arrays with the letters of the anagram and the Count of the number of letters in each anagram. I would like to compare the counts of each column that does not match the count or is null on StringArray1. I tried using compare object but it is not finding the B's for some reason. I was hoping someone could point me on where to go from here. And maybe have a simple example of how to compare Multiple columns in a tuple instead of the entire object. My google fu seems to be failing me on this one.

http://pastebin.com/69VgAfyA

Posted Jan 15, 2016, 2:27 AM UTC

15
gangstanthony•

i don't understand the question. you said you tried using compare object - can you show your code for that? as well as your desired result

1
ProthagarusOP•

Sure thing! one minute.

1
ProthagarusOP•
1
gangstanthony•

maybe something like this?

diff $string1.ToCharArray() $string2.ToCharArray()
1
ProthagarusOP•

Kind of what I was going for. I was thinking of subtracting the counts from String 1 to String 2 so I can tell how many letters I am off by. String1 has 1 more B than string2 and String2 has 1 more C than string1.

1