How do I get a substring of a string in Python?

Posted by Editorial Staff | Updated on

Want to get a substring of a string in Python? Use the following python example code:

Python calls this concept “slicing” and it works on more than just strings. Take a look here for a comprehensive introduction.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers