Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It's not clear where the extra "|" is meant to come from - if <code>getAction()</code> just returns <code>expt</code>, the result would be <code>12/03/2013|04-AERTY|12.4724|expt</code>.</p> <p>Anyway, I think it's safe to say that string concatenation will be working fine, and something else is wrong. You should add more diagnostics, logging everything:</p> <pre><code>public void handleSuccess(String result) { result = result.trim(); log.info("Result after trimming: '" + result + "'"); result = result.substring(result.indexOf('\n') + 1); log.info("Result after substring: '" + result + "'"); String returns = getReturns(); log.info("Returns: '" + returns + "'"); String action = getAction(); log.info("Action: '" + action + "'"); // It's not clear what this is meant to do. I suggest you remove it and // use logging instead. MessageBox.alert("Information", "The selected action is " + action, null); String finalResult = result + returns + action; log.info("Final result: '" + finalResult + "'"); </code></pre> <p>I <em>suspect</em> you'll find that <code>action</code> is an empty string in the broken case.</p> <p>Note that I've added quotes round each of the logged values, very deliberately. That means that if there's some unprintable character at the end of a string which causes problems, you should be able to detect that in the logging.</p> <p>EDIT: As per the comment thread, when these were turned into message boxes (as it turns out this is running in GWT) it looks like there's something wrong with the early strings, as the closing <code>'</code> isn't seen in diagnostics, in the broken case. The OP is going to investigate further.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload