<?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>Easy Ruby On Rails Programming &#187; strings</title>
	<atom:link href="http://easyrubyonrailsprogramming.com/tag/strings/feed/" rel="self" type="application/rss+xml" />
	<link>http://easyrubyonrailsprogramming.com</link>
	<description>The Place to be to Learn Ruby On Rails</description>
	<lastBuildDate>Sat, 24 Dec 2011 05:30:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Strings (Part 4)</title>
		<link>http://easyrubyonrailsprogramming.com/development/strings-part-4/</link>
		<comments>http://easyrubyonrailsprogramming.com/development/strings-part-4/#comments</comments>
		<pubDate>Mon, 05 May 2008 03:55:39 +0000</pubDate>
		<dc:creator>Avatar</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programming Basics]]></category>
		<category><![CDATA[literals]]></category>
		<category><![CDATA[strings]]></category>

		<guid isPermaLink="false">http://easyrubyonrailsprogramming.com/development/strings-part-4/</guid>
		<description><![CDATA[Below is an example of a document that consists of lines in the source but without the terminating string that is needed after the &#8220;&#60;&#60;&#8221; character. This terminator must start in the first column but with the minus &#8220;-&#8221; sign after the &#8220;&#60;&#60;&#8221; character, indention can be done on that specific terminator\ as shown below. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.shredacademy.com/forum/index.php%3Fshowtopic%3D955%26view%3Dgetlastpost"><img src="/wp-content/uploads/scraped/41.jpg"/></a>
<p>Below is an example of a document that consists of lines in the source but without the terminating string that is needed after the &#8220;&lt;&lt;&#8221; character. This terminator must start in the first column but with the minus &#8220;-&#8221; sign after the &#8220;&lt;&lt;&#8221; character, indention can be done on that specific terminator\ as shown below.</p>
<p>print &lt;&lt;-STRING1, &lt;&lt;-STRING2<br />
  Con<br />
  STRING1<br />
    centrate<br />
    STRING2</p>
<p>Gives you</p>
<p>  Con<br />
    centrate</p>
<p>In the next posts, we would discuss strings further for they are considered to be the largest Ruby class, with over 75 standard methods making it the most used data type in the whole of Ruby.</p>
]]></content:encoded>
			<wfw:commentRss>http://easyrubyonrailsprogramming.com/development/strings-part-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strings (Part 3)</title>
		<link>http://easyrubyonrailsprogramming.com/development/strings-part-3/</link>
		<comments>http://easyrubyonrailsprogramming.com/development/strings-part-3/#comments</comments>
		<pubDate>Thu, 01 May 2008 03:55:39 +0000</pubDate>
		<dc:creator>Avatar</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programming Basics]]></category>
		<category><![CDATA[literals]]></category>
		<category><![CDATA[strings]]></category>

		<guid isPermaLink="false">http://easyrubyonrailsprogramming.com/development/strings-part-3/</guid>
		<description><![CDATA[There are more ways of constructing string literals such as %q, %Q and &#8220;here documents.&#8221; The first two are used to starte single or double-quoted strings such as; %q/general single-quoted string/ &#62;&#62; general single-quoted string %Q!general single-quoted string! &#62;&#62; general double-quoted string %Q{Seconds/day: #{24*60*60}} &#62;&#62; Seconds/day: 86400 The character following the &#8220;q&#8221; or &#8220;Q&#8221; is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://weblogs.asp.net/bradvincent/archive/2007/10/22/220-berutils-part-3-strings.aspx"><img src="/wp-content/uploads/scraped/40.jpg"/></a>
<p>There are more ways of constructing string literals such as %q, %Q and &#8220;here documents.&#8221; The first two are used to starte single or double-quoted strings such as;</p>
<p>%q/general single-quoted string/	&gt;&gt; general single-quoted string<br />
%Q!general single-quoted string!	&gt;&gt; general double-quoted string<br />
%Q{Seconds/day: #{24*60*60}}		&gt;&gt; Seconds/day: 86400</p>
<p>The character following the &#8220;q&#8221; or &#8220;Q&#8221; is the delimiter that if it is an opening bracket, brace, parenthisis or a less than sign, the string is read tilla matching closing symbol is found, if not it continues on reading till the next ocurence of the same delimiter is found. The last type of string literal is the &#8220;here document&#8221; shown below.</p>
<p>a String = &lt;&lt;END_OF_STRING<br />
	The body of the string is the<br />
	input lines up to the one line<br />
	that ends with the same text<br />
	that followed the &#8216;&lt;&lt;&#8217;<br />
END_OF_STRING</p>
]]></content:encoded>
			<wfw:commentRss>http://easyrubyonrailsprogramming.com/development/strings-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl Differences in string handling</title>
		<link>http://easyrubyonrailsprogramming.com/development/perl-differences-in-string-handling/</link>
		<comments>http://easyrubyonrailsprogramming.com/development/perl-differences-in-string-handling/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 03:52:35 +0000</pubDate>
		<dc:creator>Avatar</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Programming Basics]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[strings]]></category>

		<guid isPermaLink="false">http://easyrubyonrailsprogramming.com/development/perl-differences-in-string-handling/</guid>
		<description><![CDATA[A note to Perl users, strings that contain numbers will not be automatically converted to numbers when used in an expression such as when trying to read numbers from a file like the one below does. DATA.each do &#124;line&#124; vals = line.split # split line, storing tokens in val print vals[0] + vals[1], &#8221; &#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wellho.net/picture/tclstrings.html"><img src="/wp-content/uploads/scraped/37.jpg"/></a>
<p>A note to Perl users, strings that contain numbers will not be automatically converted to numbers when used in an expression such as when trying to read numbers from a file like the one below does.</p>
<p>DATA.each do |line|<br />
   vals = line.split    # split line, storing tokens in val<br />
   print vals[0] + vals[1], &#8221; &#8221;<br />
end</p>
<p>If you use a file as input that contains,</p>
<p>2 8<br />
9 6<br />
1 4</p>
<p>You&#8217;ll end up with; 28, 96 and 14 where they were treated as strings and not numbers. Using the string#to_i method which converts the string into an integer you get the desired result.</p>
<p>Sample for string#to_i string to integer conversion</p>
<p>DATA.each do |line|<br />
   vals = line.split    # split line, storing tokens in val<br />
   print vals[0].to_i + vals[1].to_i, &#8221; &#8221;<br />
end</p>
<p>Yielding the right answers; 10 15 5</p>
]]></content:encoded>
			<wfw:commentRss>http://easyrubyonrailsprogramming.com/development/perl-differences-in-string-handling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

