Login  Register

string macro functions

Posted by Leoncio Vergara on Nov 18, 2020; 2:09am
URL: http://imagej.273.s1.nabble.com/string-macro-functions-tp5024194.html

Hi

A very basic question: how do I use these string functions?

These string functions, where 's' is a string variable, are also available: s.charAt(i), s.contains(s2), s.endsWith(s2), s.indexOf(s2), s.lastIndexOf(s2), s.length, s.matches(s2), s.replace(s1,s2), s.startsWith(s2), s.substring(i1,i2), s.substring(i), s.toLowerCase, s.toUpperCase, s.trim.

they are mentioned in the built in macro functions list, but I couldn't figure to make them work. I get an error message.

for example for  s.charAt(i), I tried the following:

ID="A09";
X=ID.charAt(1);
print(X);

thinking it would print "A" or "0"... but nope...

Thanks for your help.

Leo V.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html