Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert string ordinals to integer

Status
Not open for further replies.

phyrtech

IS-IT--Management
Jan 30, 2004
12
0
0
US
I have done some searching and there may well be no solution for what I'm doing.

I am attempting to (in a general manner) convert ordinal strings (first, second, third, forth, etc.) into integers. Something akin to:

Ordinal.Parse("first") would yield 1 as an integer type.

Does this functionality exist in the .NET framework or do I need to role my own?

Thanks in advance.

Phyrstorm Technologies, Inc.
 
You'll probably need to roll your own. You could make your life much easier by representing as 1st, 2nd, 3rd, 4th .. 9th

Here's an integer to word implementation:
I suspect that the reverse would be much harder to implement though, and then become more difficult still as you throw ordinal definition into the mix.

[small]----signature below----[/small]
The author of the monograph, a native of Schenectady, New York, was said by some to have had the highest I.Q. of all the war criminals who were made to face a death by hanging. So it goes.

My Crummy Web Page
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top