Bidi isRightToLeft() method in Java with Examples Last Updated : 18 Jan, 2022 Comments Improve Suggest changes Like Article Like Report The isRightToLeft() method of java.text.Bidi class is used to check if it has right to left line and base direction both or not.Syntax: public boolean isRightToLeft() Parameter: This method accepts nothing as parameter.Return Value: This method return true if this bidi has both right to left line and base direction otherwise false.Below are the examples to illustrate the isRightToLeft() method:Example 1: Java // Java program to demonstrate // isRightToLeft() method import java.text.*; import java.util.*; import java.io.*; public class GFG { public static void main(String[] argv) { // creating and initializing Bidi // with base direction Bidi bidi = new Bidi( "Geeks For Geeks", Bidi.DIRECTION_LEFT_TO_RIGHT); // checking both line and base direction // using isRightToLeft() method boolean status = bidi.isRightToLeft(); // display the result if (status) System.out.println( "Both Line and Base " + "direction is right to left"); else System.out.println( "Both Line and Base " + "direction is not right to left"); } } Output: Both Line and Base direction is not right to left Example 2: Java // Java program to demonstrate // isRightToLeft() method import java.text.*; import java.util.*; import java.io.*; public class GFG { public static void main(String[] argv) { // creating and initializing // AttributedString Object AttributedString attr = new AttributedString("GEEkS"); // adding attribute of language // using addAttribute() method attr.addAttribute( AttributedCharacterIterator .Attribute .LANGUAGE, new Locale("ar_QA")); // creating and initializing Bidi // with AttributedCharacterIterator Bidi bidi = new Bidi(attr.getIterator()); // checking both line and base direction // using isRightToLeft() method boolean status = bidi.isRightToLeft(); // display the result if (status) System.out.println( "Both Line and Base " + "direction is right to left"); else System.out.println( "Both Line and Base " + "direction is not right to left"); } } Output: Both Line and Base direction is not right to left Reference: https://docs.oracle.com/javase/9/docs/api/java/text/Bidi.html#isRightToLeft-- Comment More infoAdvertise with us Next Article Bidi isRightToLeft() method in Java with Examples R rohitprasad3 Follow Improve Article Tags : Java Java-Functions Java-text package Java-Bidi Practice Tags : Java Similar Reads Bidi isLeftToRight() method in Java with Examples The isLeftToRight() method of java.text.Bidi class is used to check if it has left to right line and base direction both or not. Syntax: public boolean isLeftToRight() Parameter: This method accepts nothing as parameter. Return Value: This method return true if this bidi has both left to right line 2 min read Duration isNegative() method in Java with Examples The isNegative() method of Duration Class in java.time package is used to check if this duration is negative or not. It returns a boolean value depicting the same. Syntax: public boolean isNegative() Parameters: This method do not accepts any parameter. Return Value: This method returns a boolean va 1 min read Instant isAfter() method in Java with Examples isAfter() method of an Instant class is used to check if this instant is after the instant passed as parameter or not. This method returns a boolean value showing the same. Syntax: public boolean isAfter(Instant otherInstant) Parameter: This method takes a parameter otherInstant which is the other i 2 min read Year isAfter() method in Java with Examples The isAfter() method of Year class in Java is used to check if this current Year object is after the Year specified as parameter to this method. Syntax: public boolean isAfter(Year otherYear) Parameter: It accepts a single parameter otherYear with which the current Year object is to be compared. Ret 2 min read Bidi getBaseLevel() method in Java with Examples The getBaseLevel() method of java.text.Bidi class is used to get the base level of this instance of Bidi Class. Base level means whether this Bidi instance has base level "left to right" or "right to left". Syntax: public int getBaseLevel() Parameter: This method accepts nothing as parameter. Return 2 min read Like