Class StringUtil
- java.lang.Object
-
- org.uitnet.testing.smartfwk.ui.core.utils.StringUtil
-
public class StringUtil extends Object
- Author:
- Madhav Krishna
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancontainsText(String str, String text)Checks whether the text exist in string or not.static booleancontainsWord(String str, String word)Checks whether a word present in a string.static booleanendsWithText(String str, String text)Checks if string ends with a text.static booleanisEmptyAfterTrim(String str)static booleanisEmptyNoTrim(String str)static booleanisTextMatchedWithExpectedValue(String text, String expectedValue, TextMatchMechanism textMatchMechanism)Checks whether the text matches with expected value based on text match mechanism.static voidmain(String[] args)static booleanstartsWithText(String str, String text)Checks if the string starts with text.static Stringtrim(String str)Trims the leading and trailing spacesstatic StringtrimNullAsEmpty(String str)static StringtrimNullObjAsEmptyStr(Object obj)
-
-
-
Method Detail
-
trim
public static String trim(String str)
Trims the leading and trailing spaces- Parameters:
str-- Returns:
-
isEmptyAfterTrim
public static boolean isEmptyAfterTrim(String str)
-
isEmptyNoTrim
public static boolean isEmptyNoTrim(String str)
-
containsText
public static boolean containsText(String str, String text)
Checks whether the text exist in string or not.- Parameters:
str-text-- Returns:
-
startsWithText
public static boolean startsWithText(String str, String text)
Checks if the string starts with text.- Parameters:
str-text-- Returns:
-
endsWithText
public static boolean endsWithText(String str, String text)
Checks if string ends with a text.- Parameters:
str-text-- Returns:
-
containsWord
public static boolean containsWord(String str, String word)
Checks whether a word present in a string.- Parameters:
str-word-- Returns:
-
isTextMatchedWithExpectedValue
public static boolean isTextMatchedWithExpectedValue(String text, String expectedValue, TextMatchMechanism textMatchMechanism)
Checks whether the text matches with expected value based on text match mechanism.- Parameters:
actualValue-expectedValue-textMatchMechanism-- Returns:
- if matches then returns true else returns false.
-
main
public static void main(String[] args)
-
-