<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>RegEx | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/regex/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 10 Dec 2022 05:10:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>How to convert a sentence to a Title case in JavaScript</title>
		<link>https://studentprojects.in/software-development/javascript/javascript-tricks/how-to-convert-a-sentence-to-a-title-case-in-javascript/</link>
					<comments>https://studentprojects.in/software-development/javascript/javascript-tricks/how-to-convert-a-sentence-to-a-title-case-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 10 Mar 2022 18:34:42 +0000</pubDate>
				<category><![CDATA[JavaScript Tricks]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Title case]]></category>
		<category><![CDATA[Regular expression]]></category>
		<category><![CDATA[RegEx]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=8622</guid>

					<description><![CDATA[<p>Title case is any text, such as in a title or heading, where the first letter of words is capitalized. So we can achieve this by changing the first element of every word in a sentence to uppercase while leaving the other elements in lowercase. Output</p>
<p>The post <a href="https://studentprojects.in/software-development/javascript/javascript-tricks/how-to-convert-a-sentence-to-a-title-case-in-javascript/">How to convert a sentence to a Title case in JavaScript</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Title case is any text, such as in a title or heading, where the first letter of words is capitalized. So we can achieve this by changing the first element of every word in a sentence to uppercase while leaving the other elements in lowercase.</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">function toTitleCase(string) {
  if (string === null || string === '') {
    return '';
  }
  return string.replace(/\w\S*/g, function (txt) {
    return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
  });
}

const output = toTitleCase("javascript is very easy to learn");
console.log(output);</code></pre>



<p>Output</p>



<pre class="wp-block-code"><code class="">Javascript Is Very Easy To Learn</code></pre>



<p></p><p>The post <a href="https://studentprojects.in/software-development/javascript/javascript-tricks/how-to-convert-a-sentence-to-a-title-case-in-javascript/">How to convert a sentence to a Title case in JavaScript</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/javascript/javascript-tricks/how-to-convert-a-sentence-to-a-title-case-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
