{"id":3842,"date":"2022-11-21T13:44:17","date_gmt":"2022-11-21T13:44:17","guid":{"rendered":"https:\/\/info.documotor.com\/?page_id=3842"},"modified":"2023-03-22T12:28:22","modified_gmt":"2023-03-22T12:28:22","slug":"to_titlecase","status":"publish","type":"page","link":"https:\/\/info.documotor.com\/?page_id=3842","title":{"rendered":"To_titlecase"},"content":{"rendered":"\n<p>The function <code>to_titlecase<\/code> can be used to transform the casing of a string. <\/p>\n\n\n\n<h3>Syntax<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">string to_titlecase(string $input, string &amp;culture)<\/code><\/pre>\n\n\n\n<p>Formats a $string into title case. The first letter of every word is made uppercase and the remaining characters are set to lowercase. The function also expects a given culture for the chosen writing system.<\/p>\n\n\n\n<h3>Parameters<\/h3>\n\n\n\n<p><strong>$input: <\/strong>The string to transform casing.<br><strong>&amp;culture:<\/strong> A string defining the culture of the $input. Should follow&nbsp;<em>language culture name<\/em>, based on&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes\">ISO-639-1<\/a>&nbsp;(ie. \u2018en-US\u2018, \u2018es-ES\u2018).  <\/p>\n\n\n\n<h3>Example<\/h3>\n\n\n\n<pre title=\"Data\" class=\"wp-block-code\"><code lang=\"json\" class=\"language-json line-numbers\">{\n    \"a\": \"change casing to title\"\n}<\/code><\/pre>\n\n\n\n<pre title=\"Transformation\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\">{\n    NewString: to_titlecase(a, 'en-US')\n}<\/code><\/pre>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"json\" class=\"language-json line-numbers\">{\n    \"NewString\": \"Change Casing To Title\"\n}<\/code><\/pre>\n\n\n\n<p>In this example, the casing of the string is changed to title case.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The function to_titlecase can be used to transform the casing of a string. Syntax Formats a $string into title case. The first letter of every word is made uppercase and the remaining characters are set to lowercase. The function also expects a given culture for the chosen writing system. Parameters $input: The string to transform [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":271,"menu_order":196,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/3842"}],"collection":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3842"}],"version-history":[{"count":16,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/3842\/revisions"}],"predecessor-version":[{"id":3968,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/3842\/revisions\/3968"}],"up":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/271"}],"wp:attachment":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}