Replacing values in a string

I’m trying to capture some page info to throw into header tags. i’m getting the data I want using this:

set field=“pageTitle” from=“sri.screenUrlInfo.extraPathNameList”

but the string I’m getting has some non-alpha characters in it. Specifically the left and right bracket [ ]
To experiment, I tried just getting rod of the alpha ‘a’ in the string.

set field=“pageTitle” from=“sri.screenUrlInfo.extraPathNameList.replaceAll(‘a’,’ ')”

I’ve tried several different permutations, but get the following error:

No signature of method: java.util.ArrayList.replaceAll() is applicable for argument types: (String, String) values: [a, ]

Is there a better way to manipulate string values once I’ve captured them in a field?

1 Like

I believe that we may be dealing with an XY Problem.

What was your original problem with having the [ and ] characters in a string?

From what I understand of the project, I think that text is going to be in an html file. I don’t think that the [ and ] are going to be parsed correctly in an xml file.

Not sure why you need the [ and ] characters in this string, but if the suggestions above don’t work, maybe try encoding your text.

Good luck!

The actual problem was that I wasn’t actually dealing with a string. Hence the error. I was assuming that that value being assigned to the field variable was being cast as a sting, but it wasn’t.

1 Like

@Jwager sounds like you got it fixed. Is that right?

Yes, I have.

1 Like