Delete characters from starting of the string in java
To remove some characters from starting of the string we have removeStart() method in StringUtils class.
removeStart() method removes only some characters at the start of the string and returns remaining string.Removes only characters from start of the string only if characters are found. Continue reading
Removing white spaces from String in java
To remove whitespaces from String in java we have a deleteWhitespace() method in String Class. Continue reading
Joining array of Strings with separator in java:
To join array of Strings in java with separator we have a join method in Stringutils class. Continue reading
To join mutliple strings in java we can use concatenation operator + or we can use third party api like stringutils.As most of the people know how to use concatenation operator we will join multiple Strings using StringUtils join method. Continue reading
Splitting String by uppercase in java:
To split a string by uppercase use splitByCharacterTypeCamelCase method in Stringutil class. Continue reading
Splitting a string by comma with example:
To split string by comma we have a Split method in StringUtils class.
Syntax : public static String split(final String str, final char separatorChar)
Split method accepts two arguments one takes String.which you are going to split. Continue reading
Splitting Strings in Java by Spaces:
To splitStrings in java by white spaces we have a split method in StringUtils which separate Strings based on whitespaces.
After splitting Strings based on white spaces,the method returns String array. Continue reading
Removing numbers from String in java
To remove numbers from String in java we have a method in stringutils which removes number from starting and ending of the string. Continue reading
Remove starting and ending spaces from string:
To remove beginning and ending spaces from string we can use Stringutils.strip method.
Stringutils strip method returns null when strip method is used with null.
Ex :StringUtils.strip(null) returns null.
Stringutils.strip(” Hello World “) returns “Hello World”. Continue reading
Find number of occurences of String in java:
To find the number of occurences in string follow below steps:
1) Iterate through each character.
2) compare each character with the character to find number of occurences. Continue reading