0

Hi guys,

I'm trying to read a file which contains text in arabic. The file text is aligned from right to left. But when I read it, the output is from left to right. Is there any way to align it from right to left? I'm trying to display the contents on the console.

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by muddy900
0

try this;

public class R2L
{
  public R2L()
  {
    super();
    String s = "hello";
    reversedPrintln(s);
  }

  public static void main(String[] args)
  {
    R2L r2L = new R2L();
  }

  public void reversedPrint(String string)
  {
    for(int index = string.length() - 1; index >= 0; index--)
      System.out.print(string.charAt(index));
  }

  public void reversedPrintln(String string)
  {
    reversedPrint(string);
    System.out.println();
  }
}
0

Hey thanks. Instead of writing to the console if i write to a file instead it seems to work fine, though only on linux. On windows the output is still wrong. Weird.
Thanks again. :)

Edited by muddy900: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.