{"id":79296,"date":"2020-07-04T09:00:21","date_gmt":"2020-07-04T03:30:21","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=79296"},"modified":"2020-07-04T09:00:21","modified_gmt":"2020-07-04T03:30:21","slug":"python-string-functions","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/","title":{"rendered":"Python String Functions with Examples"},"content":{"rendered":"<p>Strings are everywhere! While interacting with the user, i.e., while getting <strong>input<\/strong> or <strong>displaying output<\/strong>, you\u2019ll use strings more than any other data structure.<\/p>\n<p>In this article, you\u2019ll learn what Python strings are and how you can <strong>manipulate<\/strong> and use them in your Python program with <strong>Python String Functions<\/strong>.<\/p>\n<h3>Strings in Python<\/h3>\n<p>A <strong>single character<\/strong> or a <strong>sequence of characters<\/strong> identify as strings in Python. Strings are one of the <strong>primitive data structures<\/strong> in Python.<\/p>\n<p>A very important thing while working with strings is that strings are <strong>\u201cimmutable\u201d<\/strong>. That is, once we create a string, we cannot change its <strong>value<\/strong>.<\/p>\n<p>So to manipulate strings, we\u2019ll need to <strong>create<\/strong> new strings as we go, while the <strong>original<\/strong> strings stay <strong>intact<\/strong>.<\/p>\n<h3>How to Spot Python String?<\/h3>\n<p>We always enclose a string within <strong>quotes<\/strong>, either <strong>single-quotes<\/strong> or <strong>double-quotes<\/strong>. There can be as many characters in a string as you want, given there\u2019s enough <strong>memory<\/strong>.<\/p>\n<p><strong>For Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; \"This is a string\"\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">&#8216;This is a string&#8217;<\/div>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; 'This is a string'<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">&#8216;This is a string&#8217;<\/div>\n<p>Python also allows <strong>empty string<\/strong> in Python.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; ''<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">&#8221;<\/div>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; \"\"<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">&#8221;<\/div>\n<p>We can assign a string to a variable using the <strong>assignment operator<\/strong>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; x = \"Techvidvan\"\n&gt;&gt;&gt; print(x)\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Techvidvan<\/div>\n<h3>Python String Indexing<\/h3>\n<p>Recall that a string is just a <strong>sequence<\/strong> of characters. And like any other sequence in Python, strings support <strong>indexing<\/strong> too. That is, we can access individual characters of a string using a <strong>numeric index<\/strong>.<\/p>\n<p>Python starts counting from <strong>zero<\/strong> when it comes to numbering <strong>index locations<\/strong> of a sequence. So the first character of a string is at index <strong>0<\/strong>, the second character at index <strong>1<\/strong> and so on. We also have <strong>negative indices<\/strong> which count from <strong>right to left<\/strong>, starting with<strong> -1<\/strong>.<\/p>\n<p>Indexing uses <strong>square bracket notation<\/strong>. So this is how we access a character at index <strong>ind<\/strong> of a string<strong> my_string<\/strong>:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">my_string[ind]<\/pre>\n<p><strong>For Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; say = \"Hi from Techvidvan!\"\n&gt;&gt;&gt; say[0]\n'H'\n&gt;&gt;&gt; say[3]\n'f'\n&gt;&gt;&gt; say[5]\n'o'\n&gt;&gt;&gt; say[-1]\n'!'\n&gt;&gt;&gt; say[-3]\n'a'\n&gt;&gt;&gt; say[-5]\n'd'\n&gt;&gt;&gt; \n<\/pre>\n<h3>Python String Slicing<\/h3>\n<p>We can extend the <strong>square bracket notation<\/strong> to access a <strong>substring(slice)<\/strong> of a string. We can specify <strong>start<\/strong>, <strong>stop<\/strong> and <strong>step(optional)<\/strong> within the <strong>square brackets<\/strong> as:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">my_string[start:stop:step]<\/pre>\n<ul>\n<li><strong>start:<\/strong> It is the index from where the slice starts. The default value is <strong>0<\/strong>.<\/li>\n<li><strong>stop:<\/strong> It is the index at which the slice stops. The character at this index is not included in the slice. The default value is the <strong>length of the string<\/strong>.<\/li>\n<li><strong>step:<\/strong> It specifies the number of jumps to take while going from start to stop. It takes the default value of <strong>1<\/strong>.<\/li>\n<\/ul>\n<p><strong>For Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; say = \"Hi from Techvidvan!\"\n&gt;&gt;&gt; say[3:6]\n'fro'\n&gt;&gt;&gt; say[:10]\n'Hi from Te'\n&gt;&gt;&gt; say[4:]\n'rom Techvidvan!'\n&gt;&gt;&gt; say[1:11:3]\n'ir c'\n&gt;&gt;&gt; say[::2]\n'H rmTcvda!'\n&gt;&gt;&gt; say[::-1]\n'!navdivhceT morf iH'\n&gt;&gt;&gt; \n<\/pre>\n<h3>Python String Operations<\/h3>\n<h4>1. Python + operator &#8211; String Concatenation operator<\/h4>\n<p>The <strong>+ operator<\/strong> <strong>joins<\/strong> all the operand strings and returns a <strong>concatenated string<\/strong>.<\/p>\n<p><strong>For Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; x = \"This is \"\n&gt;&gt;&gt; y = \"Python\"\n&gt;&gt;&gt; z = x + y + '.'\n&gt;&gt;&gt; print(z)\n<\/pre>\n<p><strong>Output <\/strong><\/p>\n<div class=\"code-output\">This is Python.<\/div>\n<h4>2. Python * operator &#8211; String Replication operator<\/h4>\n<p>The<strong> * operator<\/strong> takes <strong>two <\/strong>operands &#8211; a <strong>string<\/strong> and an <strong>integer<\/strong>. It then returns a <strong>new string<\/strong> which is a number of <strong>repetitions<\/strong> of the input string. The integer operand <strong>specifies<\/strong> the number of repetitions.<\/p>\n<p><strong>For Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; x = 3 * \"Hi!\"\n&gt;&gt;&gt; print(x)\n<\/pre>\n<p><strong>Output <\/strong><\/p>\n<div class=\"code-output\">Hi!Hi!Hi!<\/div>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; y = \"Go!\" * 3\n&gt;&gt;&gt; print(y)\n<\/pre>\n<p><strong>Output <\/strong><\/p>\n<div class=\"code-output\">Go!Go!Go!<\/div>\n<h3>String Methods in Python<\/h3>\n<p>Everything in Python is an <strong>object<\/strong>. A <strong>string<\/strong> is an object too. Python provides us with various methods to <strong>call on<\/strong> the string object.<\/p>\n<p>Let\u2019s look at each one of them.<\/p>\n<p>Note that none of these methods <strong>alters<\/strong> the actual string. They instead <strong>return a copy<\/strong> of the string.This copy is the <strong>manipulated version<\/strong> of the string.<\/p>\n<h4>1. s.capitalize() in Python<\/h4>\n<p><strong>Capitalizes<\/strong> a string<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; s = \"heLLo BuDdY\"\n&gt;&gt;&gt; s2 = s.capitalize()\n&gt;&gt;&gt; print(s2)\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Hello buddy<\/div>\n<h4>2. s.lower() in Python<\/h4>\n<p>Converts all alphabetic characters to <strong>lowercase<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; s = \"heLLo BuDdY\"\n&gt;&gt;&gt; s2 = s.lower()\n&gt;&gt;&gt; print(s2)\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">hello buddy<\/div>\n<h4>3. s.upper() in Python<\/h4>\n<p>Converts all alphabetic characters to <strong>uppercase<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; s = \"heLLo BuDdY\"\n&gt;&gt;&gt; s2 = s.upper()\n&gt;&gt;&gt; print(s2)\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">HELLO BUDDY<\/div>\n<h4>4. s.title() in Python<\/h4>\n<p>Converts the <strong>first letter<\/strong> of each word to <strong>uppercase<\/strong> and remaining letters to lowercase<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; s = \"heLLo BuDdY\"\n&gt;&gt;&gt; s2 = s.title()\n&gt;&gt;&gt; print(s2)\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Hello Buddy<\/div>\n<h4>5. s.swapcase() in Python<\/h4>\n<p><strong>Swaps<\/strong> case of all alphabetic characters.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; s = \"heLLo BuDdY\"\n&gt;&gt;&gt; s2 = s.swapcase()\n&gt;&gt;&gt; print(s2)\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">&#8216;HEllO bUdDy&#8217;<\/div>\n<h4>6. s.count(&lt;sub&gt;[, &lt;start&gt;[, &lt;end&gt;]])<\/h4>\n<p>Returns the <strong>number of time<\/strong> &lt;sub&gt; occurs in s.<\/p>\n<p><strong>For Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; s = 'Dread Thread Spread'\n&gt;&gt;&gt; s.count('e')\n3\n&gt;&gt;&gt; s.count('rea')\n3\n&gt;&gt;&gt; s.count('e', 4, 18)\n2\n&gt;&gt;&gt;<\/pre>\n<h4>7. s.find(&lt;sub&gt;[, &lt;start&gt;[, &lt;end&gt;]])<\/h4>\n<p>Returns the index of the <strong>first\u00a0<\/strong><b>occurrence<\/b>\u00a0of &lt;sub&gt; in s. Returns -1 if the substring is not present in the string.<\/p>\n<p><strong>For Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; s = 'Dread Thread Spread'\n&gt;&gt;&gt; s.find('Thr')\n6\n&gt;&gt;&gt; s.find('rea')\n1\n&gt;&gt;&gt; s.find('rea', 4, 18)\n8\n&gt;&gt;&gt; s.find('x')\n-1\n&gt;&gt;&gt; \n<\/pre>\n<h4>8. s.isalnum() in Python<\/h4>\n<p>Returns True if all characters of the string are <strong>alphanumeric<\/strong>, i.e., <strong>letters<\/strong> or <strong>numbers<\/strong>.<\/p>\n<p><strong>For Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; s = \"Tech50\"\n&gt;&gt;&gt; s.isalnum()\nTrue\n&gt;&gt;&gt; s = \"Tech\"\n&gt;&gt;&gt; s.isalnum()\nTrue\n&gt;&gt;&gt; s = \"678\"\n&gt;&gt;&gt; s.isalnum()\nTrue\n<\/pre>\n<h4>9. Python s.isalpha()<\/h4>\n<p>Returns True if all the characters in the string are <strong>alphabets<\/strong>.<\/p>\n<p><strong>For Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; s = \"Techvidvan\"\n&gt;&gt;&gt; s2 = \"Tech50\"\n&gt;&gt;&gt; s.isalpha()\nTrue\n&gt;&gt;&gt; s2.isalpha()\nFalse\n&gt;&gt;&gt; \n<\/pre>\n<h4>10. Python s.isdigit()<\/h4>\n<p>Returns True if all the characters in the string are <strong>numbers<\/strong>.<\/p>\n<p><strong>For Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; s1 = \"Tech50\"\n&gt;&gt;&gt; s2 = \"56748\"\n&gt;&gt;&gt; s1.isdigit()\nFalse\n&gt;&gt;&gt; s2.isdigit()\nTrue\n&gt;&gt;&gt;\n<\/pre>\n<h4>11. s.islower()<\/h4>\n<p>Returns True if all the alphabets in the string are <strong>lowercase<\/strong>.<\/p>\n<p><strong>For Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; s1 = \"Tech\"\n&gt;&gt;&gt; s2 = \"tech\"\n&gt;&gt;&gt; s1.islower()\nFalse\n&gt;&gt;&gt; s2.islower()\nTrue\n&gt;&gt;&gt;\n<\/pre>\n<h4>12. s.isupper()<\/h4>\n<p>Returns True if all the alphabets in the string are <strong>uppercase<\/strong>.<\/p>\n<p><strong>For Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; s1 = \"Tech\"\n&gt;&gt;&gt; s2 = \"TECH\"\n&gt;&gt;&gt; s1.isupper()\nFalse\n&gt;&gt;&gt; s2.isupper()\nTrue\n<\/pre>\n<h4>13. s.lstrip([&lt;chars&gt;])<\/h4>\n<p>Removes <strong>leading characters<\/strong> from a string. Removes <strong>leading<\/strong> <strong>whitespaces<\/strong> if you don\u2019t provide a <strong>&lt;chars&gt; argument<\/strong>.<\/p>\n<h4>14. s.rstrip([&lt;chars&gt;])<\/h4>\n<p>Removes <strong>trailing characters<\/strong> from a string. Removes <strong>trailing<\/strong> <strong>whitespaces<\/strong> if you don\u2019t provide a <strong>&lt;chars&gt; argument<\/strong>.<\/p>\n<h4>15. s.strip([&lt;chars&gt;])<\/h4>\n<p>Removes <strong>leading and trailing characters<\/strong> from a string. Removes <strong>leading and trailing whitespaces<\/strong> if you don\u2019t provide a <strong>&lt;chars&gt; argument<\/strong>.<\/p>\n<p><strong>Example of lstrip(), rstrip() and strip():<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; s = \"   Techvidvan   \"\n&gt;&gt;&gt; s.lstrip()\n'Techvidvan   '\n&gt;&gt;&gt; s.rstrip()\n'   Techvidvan'\n&gt;&gt;&gt; s.strip()\n'Techvidvan'\n&gt;&gt;&gt; \n<\/pre>\n<h4>16. s.join(&lt;iterable&gt;)<\/h4>\n<p>Joins elements of an <strong>iterable<\/strong> into a <strong>single string<\/strong>. Here, <strong>s<\/strong> is the <strong>separator<\/strong> string.<\/p>\n<p><strong>Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; s1 = ' '.join(['We', 'are', 'Coders'])\n&gt;&gt;&gt; print(s1)\nWe are Coders\n&gt;&gt;&gt; s2 = ':'.join(['We', 'are', 'Coders'])\n&gt;&gt;&gt; print(s2)\nWe:are:Coders\n&gt;&gt;&gt; \n<\/pre>\n<h4>17. s.split(sep = None, maxspit = -1)<\/h4>\n<p><strong>Splits<\/strong> a string into a list of <strong>substrings<\/strong> based on <strong>sep<\/strong>. If you don\u2019t pass a value to sep, it splits based on <strong>whitespaces<\/strong>.<\/p>\n<p><strong>Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt;&gt;&gt; l = 'we are      coders'.split()\n&gt;&gt;&gt; l\n['we', 'are', 'coders']\n&gt;&gt;&gt; l = 'we are      coders'.split('e')\n&gt;&gt;&gt; l\n['w', ' ar', '      cod', 'rs']\n<\/pre>\n<h3>Summary<\/h3>\n<p>In this article, we learned what <strong>Python strings<\/strong> are. We also learned how to <strong>spot<\/strong> a string in Python program.<\/p>\n<p>Then we saw the ways to <strong>access<\/strong> an <strong>individual character<\/strong> or a <strong>slice of characters<\/strong> from a string. We learned the different <strong>operations<\/strong> we can perform on strings in Python.<\/p>\n<p>Lastly, we saw how to <strong>manipulate<\/strong> strings using <strong>built-in<\/strong> methods.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Strings are everywhere! While interacting with the user, i.e., while getting input or displaying output, you\u2019ll use strings more than any other data structure. In this article, you\u2019ll learn what Python strings are and&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":79380,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1053],"tags":[2993,2994,1156,1157,2995],"class_list":["post-79296","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-python-string-concatenation","tag-python-string-functions","tag-python-string-length","tag-python-strings","tag-python-strings-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python String Functions with Examples - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn what are strings in python,How to spot string in Python,String Indexing,String Slicing,String methods, String Operations - concatenation, replication.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python String Functions with Examples - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn what are strings in python,How to spot string in Python,String Indexing,String Slicing,String methods, String Operations - concatenation, replication.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-04T03:30:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/07\/python-string-tutorial.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python String Functions with Examples - TechVidvan","description":"Learn what are strings in python,How to spot string in Python,String Indexing,String Slicing,String methods, String Operations - concatenation, replication.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/","og_locale":"en_US","og_type":"article","og_title":"Python String Functions with Examples - TechVidvan","og_description":"Learn what are strings in python,How to spot string in Python,String Indexing,String Slicing,String methods, String Operations - concatenation, replication.","og_url":"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2020-07-04T03:30:21+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/07\/python-string-tutorial.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Python String Functions with Examples","datePublished":"2020-07-04T03:30:21+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/"},"wordCount":953,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/07\/python-string-tutorial.jpg","keywords":["python string concatenation","python string functions","python string length","python strings","python strings tutorial"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/python-string-functions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/","url":"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/","name":"Python String Functions with Examples - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/07\/python-string-tutorial.jpg","datePublished":"2020-07-04T03:30:21+00:00","description":"Learn what are strings in python,How to spot string in Python,String Indexing,String Slicing,String methods, String Operations - concatenation, replication.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/python-string-functions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/07\/python-string-tutorial.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/07\/python-string-tutorial.jpg","width":802,"height":420,"caption":"python string functions"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/python-string-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Python String Functions with Examples"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/79296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=79296"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/79296\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/79380"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=79296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=79296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=79296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}