<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Convert String to Int in Java</title>
	<atom:link href="http://www.victorchen.info/convert-string-to-int-in-java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.victorchen.info/convert-string-to-int-in-java/</link>
	<description>An array of C#, PHP, and HTML programming articles, tutorials, and resources</description>
	<lastBuildDate>Wed, 28 Jul 2010 13:55:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: nuniek nur sahaya</title>
		<link>http://www.victorchen.info/convert-string-to-int-in-java/comment-page-1/#comment-17018</link>
		<dc:creator>nuniek nur sahaya</dc:creator>
		<pubDate>Wed, 07 Apr 2010 03:48:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.victorchen.info/?p=680#comment-17018</guid>
		<description>nice information for me. thank you very much with that info.</description>
		<content:encoded><![CDATA[<p>nice information for me. thank you very much with that info.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.victorchen.info/convert-string-to-int-in-java/comment-page-1/#comment-16890</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 27 Jan 2010 07:59:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.victorchen.info/?p=680#comment-16890</guid>
		<description>This does convert a String to an int.</description>
		<content:encoded><![CDATA[<p>This does convert a String to an int.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aravind</title>
		<link>http://www.victorchen.info/convert-string-to-int-in-java/comment-page-1/#comment-16359</link>
		<dc:creator>aravind</dc:creator>
		<pubDate>Fri, 24 Jul 2009 06:11:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.victorchen.info/?p=680#comment-16359</guid>
		<description>public int IsInteger(string data)
{
		 bool result = true;

		 try
		 {
		 		 int.Parse(data);
		 }
		 catch (FormatException)
		 {
		 		 result = false;
		 }



return result;


}

ex:how the code should look:

previous code:
scanf(&quot;%d&quot;,x) should be changed into

new code:
where x is a string now
where y is bool
where x is a int

do
{
//get the interger value
scanf(&quot;%s&quot;,x)

//use the function above to find wheather the given value is int or not.
y=IsInteger(x)

//if y is true i.e int then convert it into interger using atoi function.
if(y)
{
z=atoi(z);
}
else
{
printf(&quot;error msg&quot;);

//if false then scan the variable again
}while(!y)</description>
		<content:encoded><![CDATA[<p>public int IsInteger(string data)<br />
{<br />
		 bool result = true;</p>
<p>		 try<br />
		 {<br />
		 		 int.Parse(data);<br />
		 }<br />
		 catch (FormatException)<br />
		 {<br />
		 		 result = false;<br />
		 }</p>
<p>return result;</p>
<p>}</p>
<p>ex:how the code should look:</p>
<p>previous code:<br />
scanf(&#8220;%d&#8221;,x) should be changed into</p>
<p>new code:<br />
where x is a string now<br />
where y is bool<br />
where x is a int</p>
<p>do<br />
{<br />
//get the interger value<br />
scanf(&#8220;%s&#8221;,x)</p>
<p>//use the function above to find wheather the given value is int or not.<br />
y=IsInteger(x)</p>
<p>//if y is true i.e int then convert it into interger using atoi function.<br />
if(y)<br />
{<br />
z=atoi(z);<br />
}<br />
else<br />
{<br />
printf(&#8220;error msg&#8221;);</p>
<p>//if false then scan the variable again<br />
}while(!y)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nishant</title>
		<link>http://www.victorchen.info/convert-string-to-int-in-java/comment-page-1/#comment-16199</link>
		<dc:creator>Nishant</dc:creator>
		<pubDate>Mon, 04 May 2009 20:23:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.victorchen.info/?p=680#comment-16199</guid>
		<description>Atleast write the headings properly. Its not converting String to Int, its the other way round.</description>
		<content:encoded><![CDATA[<p>Atleast write the headings properly. Its not converting String to Int, its the other way round.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
