Hi Tim,

this would be my version ...

char-pos: func [str[string!] ch[char!] /local result] [
   either found? result: find/case str ch [index? result][0] 
]                                              


regards,

Ingo



Those were the words of [EMAIL PROTECTED]:
> Hi:
>       I have written a function to find the matching index
> for a character in a string:
> 
> ;code follows:
> char-pos: func [str[string!] ch[char!] /local result]
> [
>   result: find/case str ch
>   either equal? result none [return 0]
>   [return index? find/case str ch]
> ]
<...>

--  _     .                                _
ingo@)|_ /|  _| _  <We ARE all ONE   www._|_o _   _ ._ _  
www./_|_) |o(_|(/_  We ARE all FREE> ingo@| |(_|o(_)| (_| 
http://www.2b1.de/Rebol/                     ._|      ._|

Reply via email to