{"id":903,"date":"2023-03-10T20:40:21","date_gmt":"2023-03-10T20:40:21","guid":{"rendered":"https:\/\/s-oneill.com\/sov02\/?p=903"},"modified":"2023-03-10T20:40:21","modified_gmt":"2023-03-10T20:40:21","slug":"js-string-methods","status":"publish","type":"post","link":"https:\/\/s-oneill.com\/sov02\/js-string-methods\/","title":{"rendered":"JS-String Methods"},"content":{"rendered":"<p>From <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/String\" rel=\"noopener\" target=\"_blank\">MDN<\/a>.<\/p>\n<table class=\"so-table01 table table-sm table-striped  table-hover \">\n<tbody>\n<tr class=\"so-tableheadrow\">\n<td class=\"so-tablehead\">Method<\/td>\n<td class=\"so-tablehead\">Purpose<\/td>\n<\/tr>\n<tr>\n<td>String()<\/td>\n<td class=\"so-pubDate\">\n        Creates a new String object. It performs type conversion when called as a function, rather than as a<br \/>\n        constructor, which is usually more useful.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td> .length<\/td>\n<td class=\"so-pubDate\">\n        Reflects the length of the string. Read-only.<\/td>\n<\/tr>\n<tr>\n<td> .at()<\/td>\n<td class=\"so-pubDate\">\n        Returns the character (exactly one UTF-16 code unit) at the specified index. Accepts negative integers, which<br \/>\n        count back from the last string character.\n      <\/td>\n<\/tr>\n<tr>\n<td> .charAt()<\/td>\n<td class=\"so-pubDate\">\n        Returns the character (exactly one UTF-16 code unit) at the specified index.\n      <\/td>\n<\/tr>\n<tr>\n<td> .charCodeAt()<\/td>\n<td class=\"so-pubDate\">\n        Returns a number that is the UTF-16 code unit value at the given index.\n      <\/td>\n<\/tr>\n<tr>\n<td> .codePointAt()<\/td>\n<td class=\"so-pubDate\">\n        Returns a nonnegative integer Number that is the code point value of the UTF-16 encoded code point starting at<br \/>\n        the specified pos.\n      <\/td>\n<\/tr>\n<tr>\n<td> .concat()<\/td>\n<td class=\"so-pubDate\">\n        Combines the text of two (or more) strings and returns a new <\/td>\n<\/tr>\n<tr>\n<td> .includes()<\/td>\n<td class=\"so-pubDate\">\n        Determines whether the calling string contains search<\/td>\n<\/tr>\n<tr>\n<td> .endsWith()<\/td>\n<td class=\"so-pubDate\">\n        Determines whether a string ends with the characters of the string search<\/td>\n<\/tr>\n<tr>\n<td> .indexOf()<\/td>\n<td class=\"so-pubDate\">\n        Returns the index within the calling String object of the first occurrence of searchValue, or -1 if not found.\n      <\/td>\n<\/tr>\n<tr>\n<td> .lastIndexOf()<\/td>\n<td class=\"so-pubDate\">\n        Returns the index within the calling String object of the last occurrence of searchValue, or -1 if not found.\n      <\/td>\n<\/tr>\n<tr>\n<td> .localeCompare()<\/td>\n<td class=\"so-pubDate\">\n        Returns a number indicating whether the reference string compareString comes before, after, or is equivalent to<br \/>\n        the given string in sort order.\n      <\/td>\n<\/tr>\n<tr>\n<td> .match()<\/td>\n<td class=\"so-pubDate\">\n        Used to match regular expression regexp against a <\/td>\n<\/tr>\n<tr>\n<td> .matchAll()<\/td>\n<td class=\"so-pubDate\">\n        Returns an iterator of all regexp&#8217;s matches.\n      <\/td>\n<\/tr>\n<tr>\n<td> .normalize()<\/td>\n<td class=\"so-pubDate\">\n        Returns the Unicode Normalization Form of the calling string value.\n      <\/td>\n<\/tr>\n<tr>\n<td> .padEnd()<\/td>\n<td class=\"so-pubDate\">\n        Pads the current string from the end with a given string and returns a new string of the length targetLength.\n      <\/td>\n<\/tr>\n<tr>\n<td> .padStart()<\/td>\n<td class=\"so-pubDate\">\n        Pads the current string from the start with a given string and returns a new string of the length targetLength.\n      <\/td>\n<\/tr>\n<tr>\n<td> .repeat()<\/td>\n<td class=\"so-pubDate\">\n        Returns a string consisting of the elements of the object repeated count times.\n      <\/td>\n<\/tr>\n<tr>\n<td> .replace()<\/td>\n<td class=\"so-pubDate\">\n        Used to replace occurrences of searchFor using replaceWith. searchFor may be a string or Regular Expression, and<br \/>\n        replaceWith may be a string or function.\n      <\/td>\n<\/tr>\n<tr>\n<td> .replaceAll()<\/td>\n<td class=\"so-pubDate\">\n        Used to replace all occurrences of searchFor using replaceWith. searchFor may be a string or Regular Expression,<br \/>\n        and replaceWith may be a string or function.\n      <\/td>\n<\/tr>\n<tr>\n<td> .search()<\/td>\n<td class=\"so-pubDate\">\n        Search for a match between a regular expression regexp and the calling <\/td>\n<\/tr>\n<tr>\n<td> .slice()<\/td>\n<td class=\"so-pubDate\">\n        Extracts a section of a string and returns a new <\/td>\n<\/tr>\n<tr>\n<td> .split()<\/td>\n<td class=\"so-pubDate\">\n        Returns an array of strings populated by splitting the calling string at occurrences of the substring sep.\n      <\/td>\n<\/tr>\n<tr>\n<td> .startsWith()<\/td>\n<td class=\"so-pubDate\">\n        Determines whether the calling string begins with the characters of string search<\/td>\n<\/tr>\n<tr>\n<td> .substring()<\/td>\n<td class=\"so-pubDate\">\n        Returns a new string containing characters of the calling string from (or between) the specified index (or<br \/>\n        indices).\n      <\/td>\n<\/tr>\n<tr>\n<td> .toLocaleLowerCase()<\/td>\n<td class=\"so-pubDate\">\n        The characters within a string are converted to lowercase while respecting the current locale.<br \/>\n        For most languages, this will return the same as toLowerCase()<\/td>\n<td class=\"so-pubDate\">.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td> .toLocaleUpperCase( [locale, &#8230;locales])<\/td>\n<td class=\"so-pubDate\">\n        The characters within a string are converted to uppercase while respecting the current locale.<br \/>\n        For most languages, this will return the same as toUpperCase()<\/td>\n<\/tr>\n<tr>\n<td> .toLowerCase()<\/td>\n<td class=\"so-pubDate\">\n        Returns the calling string value converted to lowercase.\n      <\/td>\n<\/tr>\n<tr>\n<td> .toString()<\/td>\n<td class=\"so-pubDate\">\n        Returns a string representing the specified object. Overrides the Object.prototype.toString()<\/td>\n<\/tr>\n<tr>\n<td> .toUpperCase()<\/td>\n<td class=\"so-pubDate\">\n        Returns the calling string value converted to uppercase.\n      <\/td>\n<\/tr>\n<tr>\n<td> .trim()<\/td>\n<td class=\"so-pubDate\">\n        Trims whitespace from the beginning and end of the <\/td>\n<\/tr>\n<tr>\n<td> .trimStart()<\/td>\n<td class=\"so-pubDate\">\n        Trims whitespace from the beginning of the <\/td>\n<\/tr>\n<tr>\n<td> .trimEnd()<\/td>\n<td class=\"so-pubDate\">\n        Trims whitespace from the end of the <\/td>\n<\/tr>\n<tr>\n<td> .valueOf()<\/td>\n<td class=\"so-pubDate\">\n        Returns the primitive value of the specified object. Overrides the Object.prototype.valueOf()<\/td>\n<\/tr>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>From MDN. Method Purpose String() Creates a new String object. It performs type conversion when called as a function, rather than as a constructor, which is usually more useful. .length Reflects the length of the string. Read-only. .at() Returns the character (exactly one UTF-16 code unit) at the specified index. Accepts negative integers, which count [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[59,21],"class_list":["post-903","post","type-post","status-publish","format-standard","hentry","category-javascript","tag-array","tag-javascript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JS-String Methods - s-oneill.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/s-oneill.com\/sov02\/js-string-methods\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JS-String Methods - s-oneill.com\" \/>\n<meta property=\"og:description\" content=\"From MDN. Method Purpose String() Creates a new String object. It performs type conversion when called as a function, rather than as a constructor, which is usually more useful. .length Reflects the length of the string. Read-only. .at() Returns the character (exactly one UTF-16 code unit) at the specified index. Accepts negative integers, which count [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/s-oneill.com\/sov02\/js-string-methods\/\" \/>\n<meta property=\"og:site_name\" content=\"s-oneill.com\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-10T20:40:21+00:00\" \/>\n<meta name=\"author\" content=\"Me(sean)\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Me(sean)\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/s-oneill.com\/sov02\/js-string-methods\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/s-oneill.com\/sov02\/js-string-methods\/\"},\"author\":{\"name\":\"Me(sean)\",\"@id\":\"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/ab11148c6ea273be80dddd8baec1a545\"},\"headline\":\"JS-String Methods\",\"datePublished\":\"2023-03-10T20:40:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/s-oneill.com\/sov02\/js-string-methods\/\"},\"wordCount\":543,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/a9217b5797251a243dfd504d7ad7d00a\"},\"keywords\":[\"array\",\"Javascript\"],\"articleSection\":[\"Javascript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/s-oneill.com\/sov02\/js-string-methods\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/s-oneill.com\/sov02\/js-string-methods\/\",\"url\":\"https:\/\/s-oneill.com\/sov02\/js-string-methods\/\",\"name\":\"JS-String Methods - s-oneill.com\",\"isPartOf\":{\"@id\":\"https:\/\/s-oneill.com\/sov02\/#website\"},\"datePublished\":\"2023-03-10T20:40:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/s-oneill.com\/sov02\/js-string-methods\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/s-oneill.com\/sov02\/js-string-methods\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/s-oneill.com\/sov02\/js-string-methods\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/s-oneill.com\/sov02\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JS-String Methods\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/s-oneill.com\/sov02\/#website\",\"url\":\"https:\/\/s-oneill.com\/sov02\/\",\"name\":\"s-oneill.com\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/a9217b5797251a243dfd504d7ad7d00a\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/s-oneill.com\/sov02\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/a9217b5797251a243dfd504d7ad7d00a\",\"name\":\"sean o\",\"logo\":{\"@id\":\"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/image\/\"},\"description\":\"Web dev over 15 years.\",\"sameAs\":[\"http:\/\/s-oneill.com\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/ab11148c6ea273be80dddd8baec1a545\",\"name\":\"Me(sean)\",\"url\":\"https:\/\/s-oneill.com\/sov02\/author\/user01\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JS-String Methods - s-oneill.com","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:\/\/s-oneill.com\/sov02\/js-string-methods\/","og_locale":"en_US","og_type":"article","og_title":"JS-String Methods - s-oneill.com","og_description":"From MDN. Method Purpose String() Creates a new String object. It performs type conversion when called as a function, rather than as a constructor, which is usually more useful. .length Reflects the length of the string. Read-only. .at() Returns the character (exactly one UTF-16 code unit) at the specified index. Accepts negative integers, which count [&hellip;]","og_url":"https:\/\/s-oneill.com\/sov02\/js-string-methods\/","og_site_name":"s-oneill.com","article_published_time":"2023-03-10T20:40:21+00:00","author":"Me(sean)","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Me(sean)"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/s-oneill.com\/sov02\/js-string-methods\/#article","isPartOf":{"@id":"https:\/\/s-oneill.com\/sov02\/js-string-methods\/"},"author":{"name":"Me(sean)","@id":"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/ab11148c6ea273be80dddd8baec1a545"},"headline":"JS-String Methods","datePublished":"2023-03-10T20:40:21+00:00","mainEntityOfPage":{"@id":"https:\/\/s-oneill.com\/sov02\/js-string-methods\/"},"wordCount":543,"commentCount":0,"publisher":{"@id":"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/a9217b5797251a243dfd504d7ad7d00a"},"keywords":["array","Javascript"],"articleSection":["Javascript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/s-oneill.com\/sov02\/js-string-methods\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/s-oneill.com\/sov02\/js-string-methods\/","url":"https:\/\/s-oneill.com\/sov02\/js-string-methods\/","name":"JS-String Methods - s-oneill.com","isPartOf":{"@id":"https:\/\/s-oneill.com\/sov02\/#website"},"datePublished":"2023-03-10T20:40:21+00:00","breadcrumb":{"@id":"https:\/\/s-oneill.com\/sov02\/js-string-methods\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/s-oneill.com\/sov02\/js-string-methods\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/s-oneill.com\/sov02\/js-string-methods\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/s-oneill.com\/sov02\/"},{"@type":"ListItem","position":2,"name":"JS-String Methods"}]},{"@type":"WebSite","@id":"https:\/\/s-oneill.com\/sov02\/#website","url":"https:\/\/s-oneill.com\/sov02\/","name":"s-oneill.com","description":"","publisher":{"@id":"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/a9217b5797251a243dfd504d7ad7d00a"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/s-oneill.com\/sov02\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/a9217b5797251a243dfd504d7ad7d00a","name":"sean o","logo":{"@id":"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/image\/"},"description":"Web dev over 15 years.","sameAs":["http:\/\/s-oneill.com"]},{"@type":"Person","@id":"https:\/\/s-oneill.com\/sov02\/#\/schema\/person\/ab11148c6ea273be80dddd8baec1a545","name":"Me(sean)","url":"https:\/\/s-oneill.com\/sov02\/author\/user01\/"}]}},"_links":{"self":[{"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/posts\/903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/comments?post=903"}],"version-history":[{"count":1,"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/posts\/903\/revisions"}],"predecessor-version":[{"id":904,"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/posts\/903\/revisions\/904"}],"wp:attachment":[{"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/media?parent=903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/categories?post=903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/s-oneill.com\/sov02\/wp-json\/wp\/v2\/tags?post=903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}