[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

askingagain

5/27/2008 3:40:00 AM

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
4 Answers

ara.t.howard

5/27/2008 3:52:00 AM

0


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

> 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
>


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



cfp:~ > ruby a.rb
65
65
"A"

a @ http://codeforp...
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama




Kam-Hung Soh

5/27/2008 5:44:00 AM

0

askingagain wrote:
> 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

See: http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_std...

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

--
Kam-Hung Soh <a href="http://kamhungsoh.com/blog"&g... Salariman</a>

BeeSting Alergy

3/11/2014 12:20:00 PM

0

Wexford was a lot better this time:
> On Monday, March 10, 2014 6:38:11 AM UTC-4, BeeSting Alergy wrote:
> > Something very bad happened to Wexford during his psychic "Nam":
> >
> > > On Sunday, March 9, 2014 4:47:28 PM UTC-4, BeeSting Alergy wrote:
> >
> > > > Cortney O'Brien
> >
> > > >
> >
> > > > Mar 08, 2014
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > He walked on stage to a sea of ?Carson 2016? signs. Then he got
> > > > to
> >
> > > >
> >
> > > > business.
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > ?America is a land of dreams,? Carson declared, before insisting
> >
> > > > this
> >
> > > >
> >
> > > > freedom is under attack by the bullies of political correctness.
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > ?People are afraid to speak up for what they believe.?
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > The conservative doctor knows a thing or two about political
> >
> > > >
> >
> > > > correctness, as he himself has been lambasted for defending
> >
> > > >
> >
> > > > conservative principles such as traditional marriage and private
> >
> > > > health
> >
> > > >
> >
> > > > care. He refused to let these attacks stop his pursuit of the
> > > > First
> >
> > > >
> >
> > > > Amendment.
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > ?I will continue to defy the PC police. They try to shut me up.
> > > > I
> >
> > > > find
> >
> > > >
> >
> > > > them pretty amusing. I still believe marriage is between a man
> > > > and a
> >
> > > >
> >
> > > > woman.?
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > Last year, the media charged Carson with comparing gay marriage
> > > > to
> >
> > > >
> >
> > > > bestiality. He said anyone who believes that is a ?dummy? and he
> >
> > > >
> >
> > > > corrected their inaccurate assumption.
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > ?Of course gay people deserve the same rights as everyone else,
> > > > but
> >
> > > >
> >
> > > > they don?t get extra rights.?
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > The media published more unfair headlines when Carson declared
> >
> > > >
> >
> > > > Obamacare is ?the worst thing since slavery.? In their
> > > > analysis, the
> >
> > > >
> >
> > > > doctor had directly compared the two.
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > Carson likened these demonizing tactics to those found in
> > > > community
> >
> > > >
> >
> > > > organizer Saul Alinsky?s Rules for Radicals. But, the doctor
> > > > said
> >
> > > >
> >
> > > > conservatives need to ?stop being intimidated? by these old,
> >
> > > > familiar
> >
> > > >
> >
> > > > strategies.
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > ?It?s time for people to stand up and proclaim what they
> > > > believe and
> >
> > > >
> >
> > > > stop being bullied.?
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > He offered a few specific solutions, including that of the
> > > > nation?s
> >
> > > >
> >
> > > > health care system:
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > ?Fight to make sure health care stays in their hands and not in
> > > > the
> >
> > > >
> >
> > > > hands of the government.?
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > Carson didn?t say whether he?s joining the presidential race in
> >
> > > > 2016,
> >
> > > >
> >
> > > > but his passionate and bold speech certainly gave those wearing
> > > > ?Run
> >
> > > >
> >
> > > > Ben Run? reasons to smile.
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > --------------------
> >
> > > >
> >
> > > >
> >
> > > >
> >
> > > > StingNote: I haven't gone through every quote to see if Dr.
> > > > Carson
> >
> > > > said some of the above. I'm sure if he did, some leftist will
> >
> > > > point it out.
> >
> > > >
> >
> > > > Just so you know.
> >
> > >
> >
> > > What PC police?
> >
> >
> >
> > Police: being Black, at midnight in a big city, sometimes a hassle.
> >
> > PC Police: being Black & Conservative for American MSM, ALWAYS A
> > HASSLE.
> >
> >
> >
> > > Why are wingers always creating hobgoblins to fight?
> >
> >
> >
> > Ask Clarence Thomas.
> >
> >
> >
> > What the Hell happened to you over in "Nam"???
> >
> >
> >
> > I'd like to know.
>
> Thomas was confirmed, but the confirmation process was, as he
> characterized it, a judicial lynching. I watched the whole thing.
> Anita Hill was an obvious loony-toon and her subsequent life as a
> professor at Oral Roberts University proved that assessment to be
> substantially true. I don't necessarily agree with Thomas's legal
> opinions, but I think his enemies in the Senate acted horribly. I was
> happy to see him get the nomination.

I was and still am happy that Clarence Thomas is a SCOTUS Justice.

> Dr. Carson isn't being tried before a kangaroo court, however, and
> there is no "PC police."

Well, the correct phrasing is, "and there ARE no "PC police"... but
that's besides the point. The fact is, MSM, political pundits and even
some politicians make it "uncomfortable" for Conservative women (Sarah
Palin), for Conservative Blacks (Ben Carson, Bill Cosby), Conservative
Latina(o)s (Marco Rubio and even crazy Ted Cruz). The group-thinking is
that if one belongs in one of the categories above, THEY ALL SHOULD BE
LIBERAL.

> If he's going to argue a position, fine, but
> I don't think it's necessary for him to portray himself as a victim
> to do so. As far as I can see, Carson was attacked not because of
> "Political Correctness:" but because he said some ridiculously stupid
> things and he's trying to squirm out of his own rhetoric by claiming
> he's the victim of PC censorship.

What did he say that was "ridiculously stupid"? I couldn't find
anything.

> I read this article then went to
> the sources thinking that Carson may have been either quoted out of
> context or been falsely quoted. Nope. He really did say those things.
> Now, apparently, he's outraged because people have called him on it.
> Too bad. That's what happen when you put yourself in the public eye.

Again, I found little... please provide one or two quotes.

Just so you know.

Yoorghis

3/11/2014 3:47:00 PM

0

On Tue, 11 Mar 2014 12:20:24 +0000 (UTC), "BeeSting Alergy"
<BeeSting_Alergy@aol.com> wrote:

>I was and still am happy that Clarence Thomas is a SCOTUS Justice.


Of course you are.

An appeal to lame vacuousness and a judicial "temperament" of a
well-educated Chicago Middle-school student are right up your alley.

In all the time Thomas has been on the bench---HE has never uttered or
written (himself) any cogent legal opinion, asked any questions in
court that would allow anyone to think he's qualified for the
position---other than being black and made Republicans look good.

Thomas does only ONE thing---that's bob his head up and down with
whatever Scalia says (or tells him to do)

IDIOT