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.
A9e3c4a01eb6d20574312fee4cdf656c?d=identicon&s=25 Rizwan Reza (hrrzone)
on 2006-04-17 16: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
E774b0336459ccf859777acfa27b57b8?d=identicon&s=25 Matt Heagney (Guest)
on 2006-04-17 17:11
(Received via mailing list)
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
D2a5b7975f49e051c1de10f98ea81f63?d=identicon&s=25 Chang Sau Sheong (Guest)
on 2006-04-17 17: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 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
This topic is locked and can not be replied to.