This is the method which links to my earlier question which I believe
needs to be converted to a ValueVector() in place of String[] to get it to
work when passing back my array to Jess? Sorry if this posts as a new
thread but its with regards to my other post with the same subject.
Thanks.

------------------------------------------------------
public String[] splitMessage(String text, int count){
        int messages = (int) Math.floor(count / 160)+1;
        String message[] = new String [messages];

        String msg = "";
        int bracket = text.lastIndexOf(')', 160);
        int space = text.lastIndexOf(' ', 160);
        int lastIndexOf = Math.max(bracket, space);
        int previous = 0;

        for(int i=1; i<=messages; i++){
                if(i==1){
                        msg = text.substring(previous, lastIndexOf+1);          
        } else {
                        msg = text.substring(previous+1, lastIndexOf+1);
                        }
                previous = lastIndexOf;
                bracket = text.lastIndexOf(')', lastIndexOf+160);
                space = text.lastIndexOf(' ', lastIndexOf+160);
                lastIndexOf = Math.max(bracket, space);
                message[i-1] = msg.trim();
                }
                return message;
}

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to