Paul McGuire wrote:
> On Apr 6, 8:53 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
I know I could use:-
if lower(string1) in lower(string2):
but it somehow feels there ought to be an easier (tidier?) way.
>> Take, for example, U+017F, LATIN SMALL LETTER LONG S. I
On Apr 6, 8:53 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> >> I know I could use:-
>
> >> if lower(string1) in lower(string2):
> >>
>
> >> but it somehow feels there ought to be an easier (tidier?) way.
>
> > Easier? You mean like some kind of mind meld?
>
> Interestingly enoug
On Apr 5, 7:14 am, Steve Holden <[EMAIL PROTECTED]> wrote:
> 7stud wrote:
>
> > Easier? You mean like some kind of mind meld?
>
> That's right, DWIM mode Python. Rock on!
If it is common enough, define a custom type of string. I have
appended a simple version that should work for your example of
>> I know I could use:-
>>
>> if lower(string1) in lower(string2):
>>
>>
>> but it somehow feels there ought to be an easier (tidier?) way.
>>
>
> Easier? You mean like some kind of mind meld?
Interestingly enough, it shouldn't be (but apparently is) obvious that
a.lower() in b.
7stud wrote:
> On Apr 4, 2:43 pm, [EMAIL PROTECTED] wrote:
>> Is there any way in python to say
>>
>> if string1 in string2:
>>
>>
>> ignoring the case of string1 and string2?
>>
>> I know I could use:-
>>
>> if lower(string1) in lower(string2):
>>
>>
>> but it somehow fee
On Apr 4, 2:43 pm, [EMAIL PROTECTED] wrote:
> Is there any way in python to say
>
> if string1 in string2:
>
>
> ignoring the case of string1 and string2?
>
> I know I could use:-
>
> if lower(string1) in lower(string2):
>
>
> but it somehow feels there ought to be an easi
Hallöchen!
[EMAIL PROTECTED] writes:
> Is there any way in python to say
>
> if string1 in string2:
>
>
> ignoring the case of string1 and string2?
You can "normalise" both first, i.e. converting to lower case.
Tschö,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
[EMAIL PROTECTED] wrote:
> Is there any way in python to say
>
> if string1 in string2:
>
>
> ignoring the case of string1 and string2?
if string1.lower() in string2.lower():
...
(there's no case-insensitive version of the "in" operator in stock Python)
--
http:
Is there any way in python to say
if string1 in string2:
ignoring the case of string1 and string2?
I know I could use:-
if lower(string1) in lower(string2):
but it somehow feels there ought to be an easier (tidier?) way.
--
Chris Green
--
http://mail.python.org/m