{"id":8534,"date":"2021-08-15T22:21:19","date_gmt":"2021-08-15T19:21:19","guid":{"rendered":"https:\/\/elzero.org\/?p=8534"},"modified":"2022-08-07T06:47:50","modified_gmt":"2022-08-07T03:47:50","slug":"python-problems-solving-remove-character-from-string","status":"publish","type":"post","link":"https:\/\/elzero.org\/old\/python-problems-solving-remove-character-from-string\/","title":{"rendered":"Remove Character From String"},"content":{"rendered":"<h3>\u0627\u0644\u062d\u0644 \u0627\u0644\u0645\u0648\u062c\u0648\u062f \u0641\u064a \u0627\u0644\u0641\u064a\u062f\u064a\u0648<\/h3>\r\n\r\n<script type=\"text\/plain\" class=\"language-python\">\r\n# First Solution\r\ndef remove_char_from(word, c):\r\n  word_without_char = []\r\n  for char in word:\r\n    if char != c.lower() and char != c.upper():\r\n      word_without_char.append(char)\r\n  return \"\".join(word_without_char)\r\n\r\n# Second Solution\r\ndef remove_char_from(word, c):\r\n  result = filter(lambda x: x != c.lower() and x != c.upper(), word)\r\n  return \"\".join(result)\r\n\r\n# Testing Ouput\r\nprint(remove_char_from(\"ElddzeroD WebDD ddSchool\", \"d\"))  # Elzero Web School\r\nprint(remove_char_from(\"ElxzeroX Web Sxchool\", \"x\"))  # Elzero Web School\r\nprint(remove_char_from(\"Elzero@ Web@@ @@School\", \"@\"))  # Elzero Web School\r\n<\/script>","protected":false},"excerpt":{"rendered":"<p>\u0627\u0644\u062d\u0644 \u0627\u0644\u0645\u0648\u062c\u0648\u062f \u0641\u064a \u0627\u0644\u0641\u064a\u062f\u064a\u0648<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1337],"tags":[],"class_list":["post-8534","post","type-post","status-publish","format-standard","hentry","category-problems-solving"],"_links":{"self":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/8534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/comments?post=8534"}],"version-history":[{"count":1,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/8534\/revisions"}],"predecessor-version":[{"id":8535,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/8534\/revisions\/8535"}],"wp:attachment":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/media?parent=8534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/categories?post=8534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/tags?post=8534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}