# Re: split not returning an array?

**URL:** <https://www.ruby-forum.com/t/re-split-not-returning-an-array/146999>\
**Category:** Ruby\
**Created:** [August 27, 2008, 12:25pm UTC](https://www.ruby-forum.com/t/re-split-not-returning-an-array/146999 "2008-08-27T12:25:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stickstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6f9a4e/32.png) [@stickstone](https://www.ruby-forum.com/u/stickstone)\
**Post date:** [August 27, 2008, 12:25pm UTC](https://www.ruby-forum.com/t/re-split-not-returning-an-array/146999/1 "2008-08-27T12:25:33Z")

</div>

> Okay you’re all right, before the split it’s already “science students”  
> … how can I stop that from happening?
> 
> I’m pulling it in through a URL for a calendar/events site. The URL  
> determines what calendars to pull events from (ie science and students),  
> so I have params[:cal] that’s supposed to store the string. Why is it  
> unescaping it for me?

Because it is defined in the specification for URLs that + means space.

If you want a real + in your URL, you have to escape it, e.g.

```
http://localhost/foo/science%2Bstudents

```

(the same applies to a number of other special characters too)

When generating links dynamically in a page for people to click on, you  
should be escaping them in this way.

Regards,

Brian.
