String Manipulation in Python
Tags: beginners, python, tutorial, productivity
Published: 2021-03-27 20:47:53

String manipulation is one of those activities in programming that we, as programmers, do all the time.

In many programming languages, you have to do a lot of the heavy lifting by yourself.

In Python, on the other hand, you have several built-in functions in the standard library to help you manipulate strings in the most different ways you can think of.

In the following articles, I showcase these many features of the language regarding strings specifically along with some nice tricks.

You can also download a PDF version with all of these tips and a few more tricks on [**Python String Manipulation Handbook**](https://renanmf.com/python-string-manipulation-handbook/).


* [How to Split a String in Python](https://renanmf.com/split-string-python/)
* [How to remove all white spaces in a string in Python](https://renanmf.com/remove-white-spaces-string-python/)
* [Multiline Strings in Python](https://renanmf.com/multiline-strings-python/)
* [lstrip(): removing spaces and chars from the beginning of a string in Python](https://renanmf.com/lstrip-remove-space-string-in-python/)
* [rstrip(): removing spaces and chars from the end of a string in Python](https://renanmf.com/rstrip-removing-spaces-chars-end-string-python/)
* [strip(): removing spaces and chars from the beginning and end of a string in Python](https://renanmf.com/strip-removing-spaces-chars-beginning-end-string-python/)
* [String Lowercase in Python](https://renanmf.com/string-lowercase-python/)
* [String Uppercase in Python](https://renanmf.com/string-uppercase-python/)
* [String Title Case in Python](https://renanmf.com/string-title-case-in-python/)
* [String Swap Case in Python](https://renanmf.com/string-swap-case-python/)
* [Checking if a string is empty in Python](https://renanmf.com/checking-string-empty-python/)
* [rjust(): right-justified string in Python](https://renanmf.com/rjust-right-justified-string-python/)
* [ljust(): left-justified string in Python](https://renanmf.com/ljust-left-justified-string/)
* [isalnum(): checking alphanumeric only in a string in Python](https://renanmf.com/isalnum-checking-alphanumeric-only-string-python/)
* [isprintable(): checking printable characters in a string in Python](https://renanmf.com/isprintable-checking-printable-characters-string-python/)
* [isspace(): checking white space only in a string in Python](https://renanmf.com/isspace-checking-white-space-only-string-python/)
* [startswith(): checking if a string begins with a certain value in Python](https://renanmf.com/startswith-checking-string-begins-certain-value-python/)
* [capitalize(): first character only to upper case in a string in Python](https://renanmf.com/capitalize-first-character-only-to-upper-case-string-python/)
* [isupper(): checking upper case only in a string in Python](https://renanmf.com/isupper-checking-upper-case-only-string-python/)
* [endswith(): check if a string ends with a certain value in Python](https://renanmf.com/endswith-check-string-ends-with-a-certain-value-python/)
* [join(): join items of an iterable into one string in Python](https://renanmf.com/join-items-iterable-into-string-python/)
* [splitlines(): splitting a string at line breaks in Python](https://renanmf.com/splitlines-splitting-string-line-breaks-python/)
* [islower(): checking lower case only in a string in Python](https://renanmf.com/islower-checking-lower-case-only-string-python/)
* [isnumeric(): checking numerics only in a string in Python](https://renanmf.com/isnumeric-checking-numerics-only-string-python/)
* [isdigit(): checking digits only in a string in Python](https://renanmf.com/isdigit-checking-digits-only-string-python/)
* [isdecimal(): checking decimals only in a string in Python](https://renanmf.com/isdecimal-checking-decimals-only-string-python/)
* [isalpha(): checking letters only in a string in Python](https://renanmf.com/isalpha-checking-letters-only-string-python/)
* [istitle(): checking if every word begins with an upper case char in a string in Python](https://renanmf.com/istitle-checking-every-word-begins-with-an-upper-case-char-string-python/)
* [expandtabs(): set the number of spaces for a tab in a string in Python](https://renanmf.com/expandtabs-number-spaces-tab-string-python/)
* [center(): centered string in Python](https://renanmf.com/center-string-python/)
* [zfill(): add zeros to a string in Python](https://renanmf.com/zfill-add-zeros-string-python/)
* [find(): check if a string has a certain substring in Python](https://renanmf.com/find-check-string-has-substring-python/)
* [Removing a Prefix or a Suffix in a String in Python](https://renanmf.com/removing-prefix-or-suffix-string-python/)
* [Python: lstrip() vs removeprefix() and rstrip() vs removesuffix()](https://renanmf.com/python-lstrip-vs-removeprefix-and-rstrip-vs-removesuffix/)
* [How to reverse a string in Python](https://renanmf.com/reverse-string-python/)
* [Understanding Slicing in Python](https://renanmf.com/slicing-python/)