Simple Problem

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

Rizwan R. <[email protected]…> 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 R. 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 S.


http://read.saush.com
http://jaccal.sourceforge.net

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs