>> to-string pick [abc/def] 1
== "abcdef"
>>
How can I get "abc/def" instead ?
>> to-string pick [abc/def] 1
== "abcdef"
>>
How can I get "abc/def" instead ?
Using string, which is delimited by {}, you can then use the ^(xx) format to insert an ASCII character by hex code.
Example:
>> to-string pick [{abc^(2F)def}] 1
== "abc/def""
>>
Use the ASCII table here if you need more codes.
For more information on REBOL strings see this link.
mold pick [abc/def] 1
== "abc/def"
Or:
form pick [abc/def] 1
=="abc/def"
The to-
family of functions were changed in Rebol 3, and your code now provides the string you want. OTOH, form
works in 2 and 3.
Are you using pick [abc/def] 1
because you wanted the literal path abc/def (and not have the interpreter try to pick def out of abc)? You can use quote to get that effect more simply:
>> form quote abc/def
== "abc/def"
And then there's the shorthand:
>> form 'abc/def
== "abc/def"