You can Use StringBuilder as below Object value = shell.evaluate("def name= new StringBuilder('James'); def fname= new StringBuilder('abd'); println name.append(fname) ;");
Groovy shell concatenate Strings
-
17-07-2023 - |
문제
I am trying to concatenate two strings using groovy shell but it's not working
groovy.shell("def name = 'MyName'; def fname = 'firstName'; println name+fname" );
But for single string this is working
groovy.shell("def name ='MyName'; println name");
Any idea about this?
해결책
제휴하지 않습니다 StackOverflow