Test string ops

This commit is contained in:
Captain ALM 2022-11-30 17:15:58 +00:00
parent 71c0fe0fad
commit 1d49cde01d
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1

17
main.py
View File

@ -1,10 +1,9 @@
#String tests
a = "hello world"
#[lw_inc:up_exc]
print(a[2:8])
print(a[:8])
print(a[2:])
#From the end
print(a[-8:-2])
print(a[-8:])
print(a[:-2])
a = " !Hello World! "
print(a.upper())
print(a.lower())
print(a.strip())
#strip(str_of_targ)
print(a.strip((" !")))
print(a.replace("H", "J"))
print(a.split(" "))