{"id":4069,"date":"2022-01-26T13:10:35","date_gmt":"2022-01-26T13:10:35","guid":{"rendered":"https:\/\/ibex.tech\/python\/?p=4069"},"modified":"2023-11-24T15:27:34","modified_gmt":"2023-11-24T15:27:34","slug":"using-strings-basics","status":"publish","type":"post","link":"https:\/\/ibex.tech\/python\/strings-python\/using-strings-basics","title":{"rendered":".Using Strings-Basics"},"content":{"rendered":"\n<p>Strings can use single or double quotes<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"Hello world\"\n\n'Hello world'<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Join strings<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>my_string = \"Hello\" + \" World\"<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Multiline strings using triple quotes<\/h4>\n\n\n\n<p>Use triple single quotes or double quotes to start and end a multiline string.<\/p>\n\n\n\n<p>Line breaks will occur for the linebreaks in the string you enter.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>my_string_a = \"\"\" Line 1\nLine 2\nLine 3\"\"\"\n\nmy_string_b  = ''' Line 1\nLine 2\nLine 3'''\n\nmy_string_a = \\\n\"\"\" Line 1\nLine 2\nLine 3\"\"\"<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Joining strings<\/h4>\n\n\n\n<p>Use the period character \u2018+\u2019<\/p>\n\n\n\n<p>You can also use +=<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    my_string = \"Some\" + \" text\";\n    my_string += \"Some more text\";<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Length<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  length = len(my_string);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Strings can use single or double quotes Join strings Multiline strings using triple quotes Use triple single quotes or double quotes to start and end a multiline string. Line breaks will occur for the linebreaks in the string you enter. Joining strings Use the period character \u2018+\u2019 You can also use += Length<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[319],"tags":[],"class_list":["post-4069","post","type-post","status-publish","format-standard","hentry","category-strings-python"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/comments?post=4069"}],"version-history":[{"count":9,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4069\/revisions"}],"predecessor-version":[{"id":4429,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4069\/revisions\/4429"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/media?parent=4069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/categories?post=4069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/tags?post=4069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}