Match beginning of two strings

Ravi rxs141 at cwru.edu
Sat Aug 2 19:28:31 EDT 2003


>>
> While you can be forgiven for not have guessed, os.path is the place to
> look:
>     import os.path
>     a = "abcdefghijklmnopqrstuvwxyz"
>     b = "abcdefghijklmnopBHLHT"
>     print os.path.commonprefix([a,b])
> 
> -Scott David Daniels
> Scott.Daniels at Acm.Org
> 

Certainly not where I was expecting it, Thanks

Ravi





More information about the Python-list mailing list