-1
I am beginner with programming mainly in Java, I have doubts about how to work with String in an arraylist, I would need to access each line in the text and modify it. Asterisk response * are correct
Input text the user types:
What’s between orange and green in the spectrum. Tick the alternative ?
*yellow
red
blue
green
purple
Output text after convert:
::Title:: What’s between orange and green in the spectrum. Check the alternative?{
*yellow
~red
~blue
~green
~purple
}
I don’t know how I can start the conversion in this arraylist
List<String> giftFormat = new ArrayList<String>();
giftFormat.add(txtEntradaDeTexto.getText());
// Percorrer arraylist, realizando a formatação
for (String integer: giftFormat) {
}
Explain better what you want.
– chriptus13
It would be a text conversion, take the string and put in an array or arraylist, at the end of the 1st line put key opening ( { ), inside the keys after finding the asterisk (correct answer) change by equal sign ( = ) and the other alternatives put til sign ( ~ ) that would be the correct answer, and below close the key ( } )
– Weslley Bezerra
Each line is a value in the initial list?
– chriptus13
That each line would be a value, first line the question, the other lines the alternatives and the last key line ( } )
– Weslley Bezerra