|
wanghom8228 Newbie
Joined: 03 Jan 2006 Posts: 7
|
Posted: Thu Feb 08, 2007 3:43 pm
How to convert a array to a text |
is it possible to convert a arry to a text.
i mean if
#var str %array("a","b","c")
how i can get a text "a|b|c" from variable "str"
of couse , we can use a loop to do it.
but if there is a better way to solve it? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Feb 08, 2007 11:01 pm |
I assume you mean you want to have "a|b|c" = "abc"? That's the easy part:
%replace(A, B, C)
A = the original text to work with (this can be a literal string like "this is a test" or it can be a variable or function result)
B = the exact substring within A you want to look for (again, literal string, variable, or function result)
C = the exact substring you want to replace B (ditto)
The far harder thing to do is to make "abc" = "a|b|c". There's no simple function do this, so you are practically required to use a looping structure coupled with some combination of the %left/%right functions.
If all you want is to get "a", "b", or "c" from the variable, just use %item(). |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|