]>
Commit | Line | Data |
---|---|---|
1 | #---------------------------------------------------------------------------- | |
2 | # Name: strutils.py | |
3 | # Purpose: String Utilities | |
4 | # | |
5 | # Author: Morgan Hua | |
6 | # | |
7 | # Created: 11/3/05 | |
8 | # CVS-ID: $Id$ | |
9 | # Copyright: (c) 2005 ActiveGrid, Inc. | |
10 | # License: wxWindows License | |
11 | #---------------------------------------------------------------------------- | |
12 | ||
13 | ||
14 | def caseInsensitiveCompare(s1, s2): | |
15 | """ Method used by sort() to sort values in case insensitive order """ | |
16 | s1L = s1.lower() | |
17 | s2L = s2.lower() | |
18 | if s1L == s2L: | |
19 | return 0 | |
20 | elif s1L < s2L: | |
21 | return -1 | |
22 | else: | |
23 | return 1 |