# What is ?E in str.index(?E)

**URL:** <https://www.ruby-forum.com/t/what-is-e-in-str-index-e/138712>\
**Category:** Ruby\
**Created:** [May 27, 2008, 5:41am UTC](https://www.ruby-forum.com/t/what-is-e-in-str-index-e/138712 "2008-05-27T05:41:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@akhot](https://www.ruby-forum.com/u/akhot)\
**Post date:** [May 27, 2008, 5:41am UTC](https://www.ruby-forum.com/t/what-is-e-in-str-index-e/138712/1 "2008-05-27T05:41:02Z")

</div>

Dear all  
I am learning Ruby. “The Ruby Way” has following example.

irb(main):047:0\> str = “Albert Einstein”  
=\> “Albert Einstein”  
irb(main):048:0\> str.index(?E)  
=\> 7  
irb(main):049:0\> str1 = “mathematics”  
=\> “mathematics”  
irb(main):050:0\> flag1 = str1.include? ?e  
=\> true  
irb(main):051:0\>

What is ?E

(Does ? above work like shell globbing?)

I tried the FAQ online but could not get anything…

TIA for any pointers/online help

– thx atul

---

<div class="post-metadata">

**Author:** ![akhot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@akhot](https://www.ruby-forum.com/u/akhot)\
**Post date:** [May 27, 2008, 5:53am UTC](https://www.ruby-forum.com/t/what-is-e-in-str-index-e/138712/2 "2008-05-27T05:53:54Z")

</div>

On May 26, 2008, at 9:39 PM, askingagain wrote:

> =\> true  
> – thx atul

cfp:~ \> cat a.rb  
p ?A  
p ‘A’[0]  
p 65.chr

cfp:~ \> ruby a.rb  
65  
65  
“A”

a @ [http://codeforpeople.com/](http://codeforpeople.com/)

---

<div class="post-metadata">

**Author:** ![akhot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@akhot](https://www.ruby-forum.com/u/akhot)\
**Post date:** [May 28, 2008, 12:47am UTC](https://www.ruby-forum.com/t/what-is-e-in-str-index-e/138712/3 "2008-05-28T00:47:42Z")

</div>

askingagain wrote:

> =\> true  
> – thx atul  
> See: [Programming Ruby: The Pragmatic Programmer's Guide](http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_stdtypes.html)

“You can also get the integer value corresponding to an ASCII character  
or escape sequence by preceding it with a question mark.”
