Преобразуване на низ в масив от символи java

Примерен код

1
0

трансформиране на всеки символ в реда в arraylist jva

import java.util.ArrayList;
import java.util.List;

// Convert a String to a List of Characters
class Util
{
	public static void main(String[] args)
	{
		String string = "Techie Delight";
		List<Character> chars = new ArrayList<>();

		for (char ch: string.toCharArray()) {
			chars.add(ch);
		}

		System.out.println(chars);
	}
}
0
0

Ред Arraylist за знак на java

String str = "abcd...";
ArrayList<Character> chars = new ArrayList<Character>();
for (char c : str.toCharArray()) {
  chars.add(c);
}

Подобни страници

Подобни страници с примери

На други езици

Тази страница на други езици

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Íslensk
..................................................................................................................