The web blog http://www.learnsccd.com strives to be a comprehensive guide to SCCD, TADDM, SERVICE NOW and MAXIMO tools. This is a personal site maintained solely by me. I intend to update it regularly.For live updates please follow us on.

String methods in Jython for Maximo Automation Script?

String methods in Jython for Maximo Automation Script


Java
Jython
Comment
String.valueOf(nonString)
str(nonString)

s.charAt(integer)
s[integer]

s.compareTo(string)
cmp(s, string)

s.concat(string)
s + string

s.endsWith(string)
s[-len(string):] == string

s.getChars(int, int, char[], int)
x = s[int:int]
Jython uses an index slice.
s.indexOf( )
s.index( ) s.find( )
find returns −1 on failure, index raises an exception.
s.lastIndexOf( )
s.rindex( ) s.rfind( )
Return values as for index and find.
s.length( )
len(s)

s.replace(char, char)
s.replace(str, str, [max])
Jython allows arguments to be of arbitrary length.
s.startsWith(string)
s[:len(string)] == string

s.substring(int, int)
s[int:int]
Jython uses an index slice.
s.toLowerCase( )
s.lower( )

s.toUpperCase
s.upper( )

s.trim( )
s.strip( )