<?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>count characters in string java - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/count-characters-in-string-java/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/count-characters-in-string-java/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Sat, 11 Sep 2021 11:04:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>count characters in string java - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/count-characters-in-string-java/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to count number of characters in a string ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/how-to-count-number-of-characters-in-a-string/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/how-to-count-number-of-characters-in-a-string/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 23:34:34 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[char to string]]></category>
		<category><![CDATA[character count]]></category>
		<category><![CDATA[check string length]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[count characters in string]]></category>
		<category><![CDATA[count characters in string java]]></category>
		<category><![CDATA[count number of characters in a string]]></category>
		<category><![CDATA[count number of characters in a string in java]]></category>
		<category><![CDATA[count occurrences of character in string java using hashmap]]></category>
		<category><![CDATA[count repeated characters in string using java]]></category>
		<category><![CDATA[count words in string]]></category>
		<category><![CDATA[dark horse digital interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[excel count characters in string]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[how to count characters in string array in java]]></category>
		<category><![CDATA[how to count the number of occurrences of a character in a string in java]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[java program to count number of alphabets in a string]]></category>
		<category><![CDATA[java program to count number of characters in a string]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[number of characters in a string]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<category><![CDATA[word counter]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=641</guid>

					<description><![CDATA[Answer : To count the amount of 'x' characters that are in a string...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="how-to-count-number-of-characters-in-a-string" class="color-pink">How to count number of characters in a string ?</h2>
</div>
</div>
<div class="Content">
<div class="hddn">
<ul>
<li>To count the amount of &#8216;x&#8217; characters that are in a string, and print out the number using java program.</li>
</ul>
</div>
</div>
<div class="CodeContent"></div>
<div class="Output">
<div class="hddn">
<figure class="highlight"><div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">class Wikitechy<br/>{ <br/>    // Method that return count of the given <br/>    // character in the string <br/>    public static int count(String s, char c) <br/>    { <br/>        int res = 0; <br/>  <br/>        for (int i=0; i&lt;s.length(); i++) <br/>        { <br/>            // checking character in string <br/>            if (s.charAt(i) == c) <br/>            res++; <br/>        }  <br/>        return res; <br/>    } <br/>      <br/>    // Driver method <br/>    public static void main(String args[]) <br/>    { <br/>        String str= &quot;Welcome to Wikitechy&quot;; <br/>        char c = &#039;W&#039;; <br/>        System.out.println(count(str, c)); <br/>    } <br/>} </code></pre> </div>
<h3 id="output">Output</h3>
<p>2</figure>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/how-to-count-number-of-characters-in-a-string/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
