Forum: Ruby on Rails Simple Problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Rizwan R. (Guest)
on 2006-04-17 18:54
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
Matt Heagney (Guest)
on 2006-04-17 19:11
(Received via mailing list)
Rizwan R. <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
Chang Sau S. (Guest)
on 2006-04-17 19:33
(Received via mailing list)
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://blog.saush.com
http://read.saush.com
http://jaccal.sourceforge.net
This topic is locked and can not be replied to.