February 6th, 2010, 07:49 PM
TR Command To Compare 2 Strings At Each Position
OK so normally I can just figure this sort of stuff out but this one is proving to be exceptionally frustrating. Basically, I need to write a subroutine that compares two strings and returns the number of times the two strings matched up at the same position, but I need to use the TR command and subtraction. For ex: bbyo boyo would return 3. I could easily do this by just going through each string char by char, but using TR and subtraction has got me stumped. From what I understand, TR just maps one set of characters to another, and it does not accept variable arguments so...Any help you can offer is greatly appreciated!
February 7th, 2010, 06:13 AM
Why do you need to use tr?