Re: Eliminate characters from line?
Posted by
Weller Andrew Francis on
URL: http://imagej.273.s1.nabble.com/passing-arguments-to-Image-Sequence-tp3702558p3702559.html
In relation to below, how would I eliminate both starting and trailing
characters, just capturing a middle component? For example, if I receive
the following:
50037631 5 2 1 164325 2 1 35 45 1
I am interested in just the "164325" part. So I guess I remove the first
n characters with:
answer = substring(answer, n, lengthOf(answer));
but how the remaining m characters?
Cheers, Andy
> Dear all,
>
> When reading from the Results Table, ie:
>
> answer = getResultLabel(0);
>
> how can I eliminate characters from the returned (answer)?
>
> For example, if the following is returned:
>
> 50062abcxyz
>
> I am only interested in "abcxyz" not the "50062" part -
> I would like them removed?
You can remove the first 5 characters from the string 'answer' using
answer = substring(answer, 5, lengthOf(answer));
-wayne