I'm having some problems with replacing String field's content in a List member.
I have a List of objects and one of the fields inside that list is String. So as an example I have the following with getters and setters.
public class MyObject {
private String message;
private int numbers;
...
Let's assume I've created a list of MyObject and there are 3 of them in that list and I've added values to them from somewhere external like a database.
List<MyObject> myObject = new ArrayList<>();
The problem lies in that String message. Let's say the String field in the first 3 entries equals as the following.
"First message"
"Second message"
"Third message"
How can I iterate through the List of myObject's String message field and replace the alphabetical content "First" with new content such as "1st" and so on and so forth.