# Re: string slice elegant way

**URL:** <https://www.ruby-forum.com/t/re-string-slice-elegant-way/76236>\
**Category:** Ruby\
**Created:** [March 3, 2006, 2:38pm UTC](https://www.ruby-forum.com/t/re-string-slice-elegant-way/76236 "2006-03-03T14:38:12Z")\
**Posts on this page:** 1\
**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:** [March 3, 2006, 2:38pm UTC](https://www.ruby-forum.com/t/re-string-slice-elegant-way/76236/1 "2006-03-03T14:38:12Z")

</div>

You can use

a=“hello there”  
b=a[2…-1]  
p b =\> “llo there”

a[2…-2]

chops off from the end.

Best regards,

Axel
