Class StringUtil
java.lang.Object
tools.StringUtil
Provides a suite of utilities for manipulating strings.
- Since:
- Revision 336
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcodeString(File file) 判斷檔案的編碼格式static StringcodeString(String fileName) static final intcountCharacters(String str, char chr) Counts the number ofchr's instr.static final intgetDaysAmount(long startMillis, long endMillis) static final StringgetLeftPaddedStr(String in, char padchar, int length) Gets a string padded from the left tolengthbypadchar.static final StringgetReadableMillis(long startMillis, long endMillis) static final StringgetRightPaddedStr(String in, char padchar, int length) Gets a string padded from the right tolengthbypadchar.static final StringjoinStringFrom(String[] arr, int start) Joins an array of strings starting from stringstartwith a space.static final StringjoinStringFrom(String[] arr, int start, String sep) Joins an array of strings starting from stringstartwithsepas a seperator.static final StringmakeEnumHumanReadable(String enumName) Makes an enum name human readable (fixes spaces, capitalization, etc)
-
Constructor Details
-
StringUtil
public StringUtil()
-
-
Method Details
-
getLeftPaddedStr
-
getRightPaddedStr
-
joinStringFrom
-
joinStringFrom
-
makeEnumHumanReadable
-
countCharacters
Counts the number ofchr's instr.- Parameters:
str- The string to check for instances ofchr.chr- The character to check for.- Returns:
- The number of times
chroccurs instr.
-
getReadableMillis
-
getDaysAmount
public static final int getDaysAmount(long startMillis, long endMillis) -
codeString
- Throws:
FileNotFoundException
-
codeString
判斷檔案的編碼格式- Parameters:
file- :file- Returns:
- 檔案的編碼格式
- Throws:
FileNotFoundException
-