(deffunction join ( ?list )
  (bind ?res "")
  (bind ?sep "")
  (foreach ?el ?list
     (bind ?res (str-cat ?res ?sep ?el))
     (bind ?sep " ")
  )
  (return ?res)
)

Use this instead of implode.
-W

On Wed, Jul 29, 2009 at 9:49 AM, jo <[email protected]> wrote:

> Maybe I will find myself but this is my problem now:
>
> (deffunction split-line (?line )
>     (bind ?s (new String ?line ))
>     (bind ?items (?s split  "[ ]+" ) )
>     (return ?items)
> )
>
> Jess> (bind ?s (split-line "a b c"))
> ("a" "b" "c")
> Jess> (bind ?t (implode$ ?s))
> "\"a\" \"b\" \"c\""
> Jess>
>
> I do not want the quotes in ?t
>
> tx
> J
>
>
>
> ------------------------------
> *From:* Wolfgang Laun <[email protected]>
> *To:* [email protected]
> *Sent:* Tuesday, July 28, 2009 7:39:47 PM
> *Subject:* Re: JESS: strings and quoting
>
> How can we read your mind? I tried Tarot cards, a Crystal Ball and ESP, but
> somehow...
>
> Kindly show an example of Jess or Java code, what it prints and what you
> expect it to do.
>
> -W
>
> On Tue, Jul 28, 2009 at 5:22 PM, jo <[email protected]> wrote:
>
>>
>> Hi  everybody,
>>
>> I am wrestling with strings in jess & java
>>
>> Now everytime strings get trough a printout to file I get more and more
>> escaped quotes and escaped backslashses,  like  ie
>>
>>      "\"\\\". mystring ...
>>
>> How can I avoid this trouble? I tries str-cat, implode$, nothing but
>> somehow quoting still occurs... Utterly confused...
>>
>> Thanks,
>>
>> --
>> Joe
>>
>>
>
>

Reply via email to