Bidi baseIsLeftToRight() method in Java with Examples Last Updated : 19 Jan, 2023 Comments Improve Suggest changes Like Article Like Report The baseIsLeftToRight() method of java.text.Bidi class is used to check if this Bidi instance has left to right base direction or not. Syntax: public boolean baseIsLeftToRight() Parameter: This method accepts nothing as parameter. Return Value: This method return true if this bidi has left to right base direction otherwise false. Below are the examples to illustrate the baseIsLeftToRight() method: Example 1: Java // Java program to demonstrate // baseIsLeftToRight() 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 base direction // using baseIsLeftToRight() method boolean status = bidi.baseIsLeftToRight(); // display the result if (status) System.out.println( "Base direction is " + "left to right"); else System.out.println( "Base direction is " + "right to left"); } } Output:Base direction is left to right Example 2: Java // Java program to demonstrate // baseIsLeftToRight() 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( "Tajmahal", Bidi.DIRECTION_RIGHT_TO_LEFT); // checking base direction // using baseIsLeftToRight() method boolean status = bidi.baseIsLeftToRight(); // display the result if (status) System.out.println( "Base direction is " + "left to right"); else System.out.println( "Base direction is " + "right to left"); } } Output:Base direction is right to left Reference: https://docs.oracle.com/javase/9/docs/api/java/text/Bidi.html#baseIsLeftToRight-- Comment More infoAdvertise with us Next Article Bidi baseIsLeftToRight() method in Java with Examples R rohitprasad3 Follow Improve Article Tags : Java Java-Functions Java-text package Java-Bidi Practice Tags : Java Similar Reads BreakIterator current() method in Java with Examples The current() method of java.text.BreakIterator class is used to get the index of recent text boundary in the line of words. It provides the offset of the text which is currently pointed by the BreakIterator. Syntax: public abstract int current() Parameter: This method does not accept any parameter. 3 min read Bidi getLength() method in Java with Examples The getLength() method of java.text.Bidi class is used to get the length of the text in this Bidi instance. Syntax: public int getLength() Parameter: This method accepts nothing as parameter. Return Value: This method provides the length of the bidi text as integer. Below are the examples to illustr 2 min read BreakIterator following() method in Java with Examples The following() method of java.text.BreakIterator class is used to return the index of the first boundary which is present after the specified offset in the line of text. it provides the offset of the first character of the next boundary which follows the passed offset's boundary. Syntax: public abs 3 min read BreakIterator preceding() method in Java with Examples The preceding() method of java.text.BreakIterator class is used to get the index of the character of the last boundary preceding the boundary of specified character offset. It provides the offset of the first character of boundary which follows or precedes the current boundary pointed by BreakIterat 3 min read BigDecimal toString() Method in Java with Examples The java.math.BigDecimal.toString() method is used to represent the current BigDecimal by which this method is called into String form, using scientific notation if an exponent is needed. It is done by following steps: A standard canonical string form of the BigDecimal is created by converting the a 3 min read Like