Match beginning of two strings

Ravi rxs141 at cwru.edu
Sun Aug 3 01:28:31 CEST 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