File: string_six.py

package info (click to toggle)
pyhst2 2020c-1
  • links: PTS, VCS
  • area: contrib
  • in suites: bullseye
  • size: 12,532 kB
  • sloc: ansic: 11,807; python: 9,663; cpp: 6,786; makefile: 147; sh: 31
file content (29 lines) | stat: -rw-r--r-- 455 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import string

def six_atoi(s):
    return int(s)

def six_atof(s):
    return float(s)

def six_lower(s):
    return s.lower()

def six_upper(s):
    return s.upper()

def six_replace(s,a,b):
    return s.replace(a,b)

def six_count(s,a):
    print(" COUNT ", s ,  " == " , a ) 
    return s.count(a)


string.atoi = six_atoi
string.atof = six_atof
string.lower = six_lower
string.upper = six_upper
string.replace = six_replace
string.count = six_count