# Beginner Question - ?/

**URL:** <https://www.ruby-forum.com/t/beginner-question/58063>\
**Category:** Ruby\
**Created:** [April 18, 2006, 3:47am UTC](https://www.ruby-forum.com/t/beginner-question/58063 "2006-04-18T03:47:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bihal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7c8e57/32.png) [@Bihal](https://www.ruby-forum.com/u/Bihal)\
**Post date:** [April 18, 2006, 3:47am UTC](https://www.ruby-forum.com/t/beginner-question/58063/1 "2006-04-18T03:47:36Z")

</div>

Hey guys

Found a strange piece of code I haven’t run into before.

```
 def redirect_to_directory_uri(req, res)
    if req.path[-1] != ?/
      location = req.path + "/"
      if req.query_string && req.query_string.size > 0
        location << "?" << req.query_string
      end
      res.set_redirect(HTTPStatus::MovedPermanently, location)
    end
  end

```

It’s the “?/” on the second line that I don’t understand. The only other  
place I can find this is in one of the required files (used in the same  
way) or at the end of a regular expression, but this is clearly not. I  
have no idea what it is. Can anybody help?

Bihal

---

<div class="post-metadata">

**Author:** ![Bihal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7c8e57/32.png) [@Bihal](https://www.ruby-forum.com/u/Bihal)\
**Post date:** [April 18, 2006, 4:20am UTC](https://www.ruby-forum.com/t/beginner-question/58063/2 "2006-04-18T04:20:21Z")

</div>

On Tue, 18 Apr 2006, Bihal wrote:

> ```
> res.set_redirect(HTTPStatus::MovedPermanently, location)
> 
> ```
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

harp:~ \> ruby -e’ [?a, ?b, ?c].each{|charcode| p charcode} ’  
97  
98  
99

-a

---

<div class="post-metadata">

**Author:** ![Bihal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7c8e57/32.png) [@Bihal](https://www.ruby-forum.com/u/Bihal)\
**Post date:** [April 18, 2006, 4:26am UTC](https://www.ruby-forum.com/t/beginner-question/58063/3 "2006-04-18T04:26:55Z")

</div>

On Apr 17, 2006, at 10:18 PM, removed\_email\_address@domain.invalid wrote:

> harp:~ \> ruby -e’ [?a, ?b, ?c].each{|charcode| p charcode} ’  
> 97  
> 98  
> 99
> 
> ## -a

And just in case this was a little cryptic, ?SOME\_CHARACTER is the  
ruby equivalent of C’s ‘SOME\_CHARACTER’ or Lisp’s #\SOME\_CHARACTER

---

<div class="post-metadata">

**Author:** ![Bihal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/7c8e57/32.png) [@Bihal](https://www.ruby-forum.com/u/Bihal)\
**Post date:** [April 18, 2006, 6:02am UTC](https://www.ruby-forum.com/t/beginner-question/58063/4 "2006-04-18T06:02:20Z")

</div>

Logan C. wrote:

> On Apr 17, 2006, at 10:18 PM, removed\_email\_address@domain.invalid wrote:
> 
> > harp:~ \> ruby -e’ [?a, ?b, ?c].each{|charcode| p charcode} ’  
> > 97  
> > 98  
> > 99
> > 
> > ## -a
> 
> And just in case this was a little cryptic, ?SOME\_CHARACTER is the  
> ruby equivalent of C’s ‘SOME\_CHARACTER’ or Lisp’s #\SOME\_CHARACTER

Thanks guys!

Bihal
