In groovy, I have an array as below.
def String=[Teacher 1, Teacher 2, Teacher 3]
How can we change this array to
def String=['"Teacher 1"','"Teacher 2"','"Teacher 3"']
It would be great if you can help me with this.
Thanks a ton in advance!
In groovy, I have an array as below.
def String=[Teacher 1, Teacher 2, Teacher 3]
How can we change this array to
def String=['"Teacher 1"','"Teacher 2"','"Teacher 3"']
It would be great if you can help me with this.
Thanks a ton in advance!
Ok, I'll bite
Couple of things wrong in the question;
Anyway, back to the question...
Given the list:
def strings = ['Teacher 1', 'Teacher 2', 'Teacher 3']
You can wrap each of them in double quotes by using:
def quotedStrings = strings.collect { '"' + it + '"' }