Hi,
I’m trying to convert this string: {1,2,3,4,5,6,7,8,9} into a list of values 1 2 3 4 5 6 7 8 9.
I have created a java service, but I am getting these brackets as well, could you please help me out?
here is what i have done, your advice is always beneficial.
Thanks in advance.
This could be solved in many ways, it is on the logic that you want to get your string converted to a list of elements.
If you are sure that every time your input is going to within { } then you could trim that off in your java service, just like this input = input.substring(1, input.length()-1);
Try and let me know if it works as per your expectation.
Glad to see you used split instead of tokenize. The tokenize method has behaviors that you likely do not want.
Regarding calling demoStrToChars is there a reason to call that using a transformer? Not an issue per se, but often people use transformers thinking it has behaviors that do not exist. We have a convention where if the transformer is the only item in the MAP step, don’t use a transformer. Just invoke the service. Improves readability.