{"id":9362,"date":"2019-11-13T13:47:25","date_gmt":"2019-11-13T16:47:25","guid":{"rendered":"http:\/\/kb.elipse.com.br\/en\/?p=9362"},"modified":"2019-11-13T13:47:25","modified_gmt":"2019-11-13T16:47:25","slug":"kb-93342-removing-spaces-from-strings","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/","title":{"rendered":"KB-93342: Removing spaces from strings."},"content":{"rendered":"<div align=\"justify\">\n<h2><b>Question:<\/b><\/h2>\n<p>When editing scripts in Elipse E3, can I remove spaces from strings? And as for spaces in the middle of strings, can they be removed too? Which function(s) should I use for this purpose?<\/p>\n<h2><b>Solution:<\/b><\/h2>\n<p>A <b>string<\/b> is traditionally a sequence of characters, either as a literal constant or as some kind of variable. When you want to remove spaces from strings in your script, there are two possibilities for fixing this, depending on where the spaces are in the string: either at its end, or in the middle of it.<\/p>\n<p>To remove blanks at the string&#8217;s end (leading and\/or trailing), use <strong>Trim<\/strong> function (as seen below):<\/p>\n<\/div>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">MyVar = Trim(\"\u00a0\u00a0 vbscript\u00a0 \")\r\n'MyVar contains \"vbscript\"<\/pre>\n<p>Likewise, you can also use <strong>LTrim<\/strong> and <strong>RTrim <\/strong>functions, depending on where the blanks are.<\/p>\n<p>According to <a href=\"https:\/\/support.office.com\/en-ie\/article\/ltrim-rtrim-and-trim-functions-e340ced1-67df-435f-b078-1527a4eddea2\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft&#8217;s documentation<\/a>, the <strong>LTrim<\/strong>, <strong>RTrim<\/strong> and <strong>Trim <\/strong>functions<strong><br \/>\n<\/strong><\/p>\n<blockquote><p>&#8220;return a <b class=\"ocpLegacyBold\">Variant<\/b> (<b class=\"ocpLegacyBold\">String<\/b>) containing a copy of a specified string without leading spaces (<b class=\"ocpLegacyBold\">LTrim<\/b>), trailing spaces (<b class=\"ocpLegacyBold\">RTrim<\/b>), or both leading and trailing spaces (<b class=\"ocpLegacyBold\">Trim<\/b>).&#8221;<\/p><\/blockquote>\n<div align=\"justify\">\n<p>&nbsp;<\/p>\n<p>On the other hand, to remove spaces in the middle or next to the string, use <strong>Replace<\/strong> function (as seen below):<\/p>\n<\/div>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">aux = \"Elipse Software \"\r\nMyString = Replace(aux, \" \",\"\")\r\n'MyString contains \"ElipseSoftware\"<\/pre>\n<p>According to <a href=\"https:\/\/support.office.com\/en-us\/article\/Replace-Function-6ACF209B-01B7-4078-B4B8-E0A4EF67D181\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft&#8217;s documentation<\/a>, <strong>Replace<\/strong> function<\/p>\n<blockquote><p>&#8220;returns a <b class=\"ocpLegacyBold\">String<\/b> in which a specified substring has been replaced with another substring a specified number of times.&#8221;<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>Using both these functions, or a combination of them (according to the case), you will be able to remove spaces from your strings safely.<\/p>\n<p>For further information on this and other functions applied to Elipse E3&#8217;s scripts, check out our section <a href=\"https:\/\/kb.elipse.com.br\/en\/category\/english\/elipse-e3-en\/scripts-4\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Elipse E3\/Scripts<\/strong><\/a>.<\/p>\n<p>For further information on string functions and how to use them, check out <a href=\"https:\/\/support.office.com\/en-us\/article\/string-functions-and-how-to-use-them-965efa84-7009-4603-9765-2eb4a099ec72\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft&#8217;s documentation<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question: When editing scripts in Elipse E3, can I remove spaces from strings? And as for spaces in the middle of strings, can they be removed too? Which function(s) should&hellip;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[763,730],"tags":[972,950,952,951,954,949],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>KB-93342: Remove spaces from strings in Elipse E3 scripts<\/title>\n<meta name=\"description\" content=\"This article illustrates how to remove spaces from strings in Elipse E3, whether they are leading, trailing, or both leading and trailing.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"KB-93342: Remove spaces from strings in Elipse E3 scripts\" \/>\n<meta property=\"og:description\" content=\"This article illustrates how to remove spaces from strings in Elipse E3, whether they are leading, trailing, or both leading and trailing.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-13T16:47:25+00:00\" \/>\n<meta name=\"author\" content=\"D\u00e9lio Damin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"D\u00e9lio Damin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/\"},\"author\":{\"name\":\"D\u00e9lio Damin\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/be597eff34b5f24af940a55332870778\"},\"headline\":\"KB-93342: Removing spaces from strings.\",\"datePublished\":\"2019-11-13T16:47:25+00:00\",\"dateModified\":\"2019-11-13T16:47:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/\"},\"wordCount\":278,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"keywords\":[\"remove blanks\",\"ltrim\",\"replace\",\"rtrim\",\"string\",\"trim\"],\"articleSection\":[\"Scripts\",\"Elipse E3\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/\",\"name\":\"KB-93342: Remove spaces from strings in Elipse E3 scripts\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2019-11-13T16:47:25+00:00\",\"dateModified\":\"2019-11-13T16:47:25+00:00\",\"description\":\"This article illustrates how to remove spaces from strings in Elipse E3, whether they are leading, trailing, or both leading and trailing.\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"KB-93342: Removing spaces from strings.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/be597eff34b5f24af940a55332870778\",\"name\":\"D\u00e9lio Damin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fdf251d36430f8dd22144c3f1bc53376?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fdf251d36430f8dd22144c3f1bc53376?s=96&d=mm&r=g\",\"caption\":\"D\u00e9lio Damin\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/delio\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"KB-93342: Remove spaces from strings in Elipse E3 scripts","description":"This article illustrates how to remove spaces from strings in Elipse E3, whether they are leading, trailing, or both leading and trailing.","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:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/","og_locale":"en_US","og_type":"article","og_title":"KB-93342: Remove spaces from strings in Elipse E3 scripts","og_description":"This article illustrates how to remove spaces from strings in Elipse E3, whether they are leading, trailing, or both leading and trailing.","og_url":"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2019-11-13T16:47:25+00:00","author":"D\u00e9lio Damin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"D\u00e9lio Damin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/"},"author":{"name":"D\u00e9lio Damin","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/be597eff34b5f24af940a55332870778"},"headline":"KB-93342: Removing spaces from strings.","datePublished":"2019-11-13T16:47:25+00:00","dateModified":"2019-11-13T16:47:25+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/"},"wordCount":278,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"keywords":["remove blanks","ltrim","replace","rtrim","string","trim"],"articleSection":["Scripts","Elipse E3"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/","url":"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/","name":"KB-93342: Remove spaces from strings in Elipse E3 scripts","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2019-11-13T16:47:25+00:00","dateModified":"2019-11-13T16:47:25+00:00","description":"This article illustrates how to remove spaces from strings in Elipse E3, whether they are leading, trailing, or both leading and trailing.","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/kb-93342-removing-spaces-from-strings\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"KB-93342: Removing spaces from strings."}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/be597eff34b5f24af940a55332870778","name":"D\u00e9lio Damin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/fdf251d36430f8dd22144c3f1bc53376?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fdf251d36430f8dd22144c3f1bc53376?s=96&d=mm&r=g","caption":"D\u00e9lio Damin"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/delio\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/9362"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=9362"}],"version-history":[{"count":4,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/9362\/revisions"}],"predecessor-version":[{"id":9366,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/9362\/revisions\/9366"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=9362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=9362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=9362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}