{"id":4300,"date":"2022-03-10T15:30:07","date_gmt":"2022-03-10T15:30:07","guid":{"rendered":"https:\/\/ibex.tech\/python\/?p=4300"},"modified":"2022-03-10T15:30:46","modified_gmt":"2022-03-10T15:30:46","slug":"comma-separated-strings","status":"publish","type":"post","link":"https:\/\/ibex.tech\/python\/strings-python\/comma-separated-strings","title":{"rendered":"Comma Separated Strings"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Convert Comma Separated&nbsp;String To List<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>my_list = my_string.split(',')<\/code><\/pre>\n\n\n\n<p>Note, when you split a string on a character that it also ends with, you\u2019ll end up with an empty string at the end of the list.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Convert List into comma separated string<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># 'delimiter'.join(list_you_want_to_join)\n# So:\nmy_string = ','.join(my_list_of_strings)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Convert Comma Separated&nbsp;String To List Note, when you split a string on a character that it also ends with, you\u2019ll end up with an empty string at the end of the list. Convert List into comma separated string<\/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-4300","post","type-post","status-publish","format-standard","hentry","category-strings-python"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4300","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=4300"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4300\/revisions"}],"predecessor-version":[{"id":4303,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4300\/revisions\/4303"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/media?parent=4300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/categories?post=4300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/tags?post=4300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}