public void characters (char ch[], int start, int length)
{
if( choice_text )
{
choice = new String(ch).substring(start,start + length);
// choice.replace( ' | ' , ' & ' ); // didn't work
XMLChoices[XMLquestion_text_counter][choice_counter] = choice;
}
//..............
for (int i = start; i < start + length; i++) {
switch (ch[i]) {
case '|':
ch[i] = '&';
break;
any help?
Jim
Remember, Strings are immutable (ie, can not change).
>
> public void characters (char ch[], int start, int length)
> {
> if( choice_text )
> {
> choice = new String(ch).substring(start,start + length);
>
> // choice.replace( ' | ' , ' & ' ); // didn't work
It does work, choice.replace returns a new string with the replced
characters, but you just throw this result away.
> XMLChoices[XMLquestion_text_counter][choice_counter] = choice;
>
> }
> //..............
> for (int i = start; i < start + length; i++) {
>
> switch (ch[i]) {
> case '|':
>
> ch[i] = '&';
>
> break;
Roger Lindsjö
Can anyone advise?
Thanks
If it's a JSP book, then certainly it says more about using both servlets
and JSPs than you let on. If not, return it and buy a real book.
If your question is more specific than that, please ask your specific
question.
Chris Smith