Class StringExtensions

java.lang.Object
org.eclipse.xtext.xbase.lib.StringExtensions

@GwtCompatible public class StringExtensions extends Object
This is an extension library for strings.
Author:
Sven Efftinge - Initial contribution and API
  • Constructor Details

    • StringExtensions

      public StringExtensions()
  • Method Details

    • operator_plus

      @Pure public static String operator_plus(String a, Object b)
      The binary + operator that concatenates a string and the string reprentation of an object.
      Parameters:
      a - a string.
      b - an object.
      Returns:
      a + b
    • operator_plus

      @Pure public static String operator_plus(String a, String b)
      The binary + operator that concatenates two strings.
      Parameters:
      a - a string.
      b - another string.
      Returns:
      a + b
      Since:
      2.5
    • isNullOrEmpty

      @Pure public static boolean isNullOrEmpty(String s)
      Returns true if s is null or equal to the empty String "".
      Parameters:
      s - the string
      Returns:
      true if s is null or equal to the empty String ""
    • toFirstUpper

      @Pure public static String toFirstUpper(String s)
      Returns the String s with an upper case first character. This function is null-safe.
      Parameters:
      s - the string that should get an upper case first character. May be null.
      Returns:
      the String s with an upper case first character or null if the input String s was null.
    • toFirstLower

      @Pure public static String toFirstLower(String s)
      Returns the String s with an lower case first character. This function is null-safe.
      Parameters:
      s - the string that should get an lower case first character. May be null.
      Returns:
      the String s with an lower case first character or null if the input String s was null.