method trim() not found

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

method trim() not found

gpatrick
I have a string that is getting a whitespace:
For input string: " 0000000000016a03"

And trying to use the trim() method:
hexa = hexa.trim()

Returns:
 128 +++ hexa = hexa.trim()
     +++             ^^^^
     +++ Error: The method 'trim()' cannot be found in class 'netrexx.lang.Rexx' or a superclass

I've imported 'java.lang.' but still always gets the same trim() method not found.  I've also tried returning "trimmed = hexa.trim()" and same message.
Reply | Threaded
Open this post in threaded view
|

Re: method trim() not found

christel.u.w.pachl christel.u.w.pachl
Try strip

-----Urspr√ľngliche Nachricht-----
Von: [hidden email]
[mailto:[hidden email]] Im Auftrag von gpatrick
Gesendet: Dienstag, 27. Jänner 2015 14:35
An: [hidden email]
Betreff: [Ibm-netrexx] method trim() not found

I have a string that is getting a whitespace:
For input string: " 0000000000016a03"

And trying to use the trim() method:
hexa = hexa.trim()

Returns:
 128 +++ hexa = hexa.trim()
     +++             ^^^^
     +++ Error: The method 'trim()' cannot be found in class
'netrexx.lang.Rexx' or a superclass

I've imported 'java.lang.' but still always gets the same trim() method not
found.  I've also tried returning "trimmed = hexa.trim()" and same message.



--
View this message in context:
http://ibm-netrexx.215625.n3.nabble.com/method-trim-not-found-tp4027349.html
Sent from the ibm-netrexx mailing list archive at Nabble.com.

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: method trim() not found

gpatrick
Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: method trim() not found

alansam
As Walter says, strip() is the NetRexx BIF for the task but you can use Java's String.tripm() method as follows:

(String hexa).trim()

hexa.toString().trim()


Regards,
Alan.


On 27 January 2015 at 07:55, gpatrick <[hidden email]> wrote:
Thank you!



--
View this message in context: http://ibm-netrexx.215625.n3.nabble.com/method-trim-not-found-tp4027349p4027351.html
Sent from the ibm-netrexx mailing list archive at Nabble.com.

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/




--
Can't tweet, won't tweet!

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Alan

--
Needs more cowbell.