Is it possible to select a portion of string? For example, in many websites, they give the first paragraph in the main page and link for the article on the other page. I remember this is available in PHP. Any help is appreciated. Thanks Rizwan -- Posted via http://www.ruby-forum.com/.
Rizwan Reza <rizwan@...> writes:> > Is it possible to select a portion of string? For example, in many > websites, they give the first paragraph in the main page and link for > the article on the other page. I remember this is available in PHP. > > Any help is appreciated. > > Thanks > Rizwan >come on, this took 3 seconds to google: ruby substring http://www.rubycentral.com/ref/ref_c_string.html
You should read the Ruby documentation at http://www.ruby-doc.org/core/ Check out the entry on String. What you are probably looking for is a_string.slice or a_string[] Rizwan Reza wrote:> Is it possible to select a portion of string? For example, in many > websites, they give the first paragraph in the main page and link for > the article on the other page. I remember this is available in PHP. > > Any help is appreciated. > > Thanks > Rizwan > >-- Sau Sheong http://blog.saush.com http://read.saush.com http://jaccal.sourceforge.net