#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2010
    Posts
    1
    Rep Power
    0

    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!
  2. #2
  3. kill 9, $$;
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2001
    Location
    Shanghai, An tSín
    Posts
    6,897
    Rep Power
    3886

IMN logo majestic logo threadwatch logo seochat tools logo