# Re: String#starts\_with?

**URL:** <https://www.ruby-forum.com/t/re-string-starts-with/102962>\
**Category:** Ruby\
**Created:** [July 8, 2006, 9:21pm UTC](https://www.ruby-forum.com/t/re-string-starts-with/102962 "2006-07-08T21:21:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [July 8, 2006, 9:21pm UTC](https://www.ruby-forum.com/t/re-string-starts-with/102962/1 "2006-07-08T21:21:48Z")

</div>

> > String#index should be the fastest

> thanks. any suggestions for #ends\_with?

If the above is correct, String#rindex.

Best regards,  
Axel

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [July 8, 2006, 9:28pm UTC](https://www.ruby-forum.com/t/re-string-starts-with/102962/2 "2006-07-08T21:28:20Z")

</div>

On 7/9/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > String#index should be the fastest
> 
> > thanks. any suggestions for #ends\_with?
> 
> If the above is correct, String#rindex.

doh - completely forgot about rindex.

martin
