So we have the following:
ArrayList<String> list = ( new ArrayList<String>( ) );
list.add( new String( "hello" ) ); // add first word at position [0]
list.add( new String( "world" ) ); // add second word at position [1]
I do not want to use the .replace method as that will replace ALL the occurrences. Suppose I only want to modify the first "l" in the hello word and change it to "x", how would I do that? I only want to target a specific element # within the string within the array.
System.out.println( list ); // display the full arraylist
Initial Output:
[hello, world]
Desired Output:
[hexlo, world]