str: "aaa*aaa*aaa*aaa"

myfunc: func [string section /mod][
    mod: copy str
    loop section [mod: find next mod "*"]
    return mod
]

Now you can get to any section you want not just the second one.

>> myfunc str 2
== "*aaa*aaa"
>> myfunc str 3
== "*aaa"
>>

Paul Tretter

----- Original Message ----- 
From: "Carlos Lorenz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 18, 2005 7:13 AM
Subject: [REBOL] Find? Copy/Part?


> 
> Hi list,
> 
> Suppose I have  str: "aaa*aaa*aaa*aaa"
> 
> Wich is the best way to get the position of second "*" at word str?
> 
> 
> -- 
> *:-.,_,.-:*'``'*:-.,_,.-:
> Carlos Lorenz
> *:-.,_,.-:*'``'*:-.,_,.-:
> -- 
> To unsubscribe from the list, just send an email to rebol-request
> at rebol.com with unsubscribe as the subject.
> 
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.6.13 - Release Date: 1/16/2005
> 
>


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.13 - Release Date: 1/16/2005

-- 
To unsubscribe from the list, just send an email to rebol-request
at rebol.com with unsubscribe as the subject.

Reply via email to