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 #String tests
a = "hello world" a = " !Hello World! "
#[lw_inc:up_exc] print(a.upper())
print(a[2:8]) print(a.lower())
print(a[:8]) print(a.strip())
print(a[2:]) #strip(str_of_targ)
#From the end print(a.strip((" !")))
print(a[-8:-2]) print(a.replace("H", "J"))
print(a[-8:]) print(a.split(" "))
print(a[:-2])