我有一系列应以对齐方式打印的英文和阿拉伯文文本。
例如:
List<Character> ar = new ArrayList<Character>();
ar.add('ا');
ar.add('ب');
ar.add('ت');
List<Character> en = new ArrayList<Character>();
en.add('a');
en.add('b');
en.add('c');
System.out.println("ArArray: " + ar);
System.out.println("EnArray: " + en);
预期输出:
ArArray: [ت, ب, ا] // <- I want characters to be printed in the order they were added to the list
EnArray: [a, b, c]
实际输出:
ArArray: [ا, ب, ت] // <- but they're printed in reverse order
EnArray: [a, b, c]
有没有办法在从左到右的方向打印阿拉伯字符而不在输出前显式反转列表?