I want to create variable from a long string to a small string.
e.g abcde!mdamdskm
to abcde
.
I know only what is the special character and not the index.
For getting only first word use index after splitting.
a="abcde!mdamdskm"
print a.split("!")[0]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With