자바 개발할때 유용한 라이브러리(library)!
StringUtils - 문자열에 작업하는 관련기능들을 모아놓은 Library
사용방법
1.직접 다운 : 다운로드페이지(click)
2.Maven : MavenRepository페이지(click)
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8</version>
</dependency>
직접 다운로드할시 lib에 추가하여 사용하고 Maven사용시엔 pom.xml에 추가한다.
String mid = StringUtils.mid("showmethemoney", 4, 5);System.out.println(mid);//출력결과 : methe
String normalizeSpace = StringUtils.normalizeSpace("show \tme the money");System.out.println(normalizeSpace);//출력결과 : show me the money
int ordinalIndexOf = StringUtils.ordinalIndexOf("abcabcabcabc", "abc", 3);System.out.println(ordinalIndexOf);//출력결과 : 6
String overlay = StringUtils.overlay("0123456789", "**", 2, 7);System.out.println(overlay);//출력결과 : 01**789
String prependIfMissing = StringUtils.prependIfMissing("Show", "me", "the");System.out.println(prependIfMissing);//출력결과 : meShow
String prependIfMissingIgnoreCase = StringUtils.prependIfMissingIgnoreCase("Show", "me", "show");System.out.println(prependIfMissingIgnoreCase);//출력결과 : Show
String remove = StringUtils.remove("s**h**o**w", "**");System.out.println(remove);//출력결과 : show
String removeAll = StringUtils.removeAll("showMETHEMONEY", "[A-Z]");System.out.println(removeAll);//출력결과 : show
String removeEnd = StringUtils.removeEnd("showME","ME");System.out.println(removeEnd);//출력결과 : show
String removeEndIgnoreCase = StringUtils.removeEndIgnoreCase("showME", "me");System.out.println(removeEndIgnoreCase);//출력결과 : show
String removeFirst = StringUtils.removeFirst("<test>show", "<.*>");System.out.println(removeFirst);//출력결과 : show
String removeIgnoreCase = StringUtils.removeIgnoreCase("sThtotwT", "t");System.out.println(removeIgnoreCase);//출력결과 : show
String removePattern = StringUtils.removePattern("<test>\n<test>show", "<.*>");System.out.println(removePattern);//출력결과 : show
String removeStart = StringUtils.removeStart("showshow", "show");System.out.println(removeStart);//출력결과 : show
String removeStartIgnoreCase = StringUtils.removeStartIgnoreCase("showshow", "SHOW");System.out.println(removeStartIgnoreCase);//출력결과 : show
String repeat = StringUtils.repeat("show",",", 3);System.out.println(repeat);//출력결과 : show,show,show
String replace = StringUtils.replace("testtest", "test", "show");System.out.println(replace);//출력결과 : showshow
String replace2 = StringUtils.replace("testtest", "test", "show",1);System.out.println(replace2);//출력결과 : showtest
String replaceAll = StringUtils.replaceAll("SHOWshowSHOW", "[A-Z]", "^");System.out.println(replaceAll);//출력결과 : ^^^^show^^^^
String replaceChars = StringUtils.replaceChars("mhoe", "me", "sw");System.out.println(replaceChars);//출력결과 : show
String replaceEach =StringUtils.replaceEach("methe", new String[]{"me", "the"}, new String[]{"sh", "ow"});System.out.println(replaceEach);//출력결과 : show
String replaceEachRepeatedly =StringUtils.replaceEachRepeatedly("me", new String[]{"m", "e"}, new String[]{"e", "d"});System.out.println(replaceEachRepeatedly);//출력결과 : dd
String replaceFirst = StringUtils.replaceFirst("show56show", "show", "1234");System.out.println(replaceFirst);//출력결과 : 123456show
String replaceIgnoreCase = StringUtils.replaceIgnoreCase("Aa", "a", "1");System.out.println(replaceIgnoreCase);//출력결과 : 11
String replaceOnce = StringUtils.replaceOnce("sshow", "s", "1");System.out.println(replaceOnce);//출력결과 : 1show
String replaceOnceIgnoreCase = StringUtils.replaceOnceIgnoreCase("sshow", "S", "1");System.out.println(replaceOnceIgnoreCase);//출력결과 : 1show
String replacePattern = StringUtils.replacePattern("<__>test<__>me", "<.*>", "show");System.out.println(replacePattern);//출력결과 : showme
String reverse = StringUtils.reverse("show");System.out.println(reverse);//출력결과 : wohs
String reverseDelimited = StringUtils.reverseDelimited("123.456.789", '.');System.out.println(reverseDelimited);//출력결과 : 789.456.123
String right = StringUtils.right("show", 2);System.out.println(right);//출력결과 : ow
String rightPad = StringUtils.rightPad("show", 10, "!@#$");System.out.println(rightPad);//출력결과 : show!@#$!@
String rotate = StringUtils.rotate("show", 2);System.out.println(rotate);//출력결과 : owsh
JAVA StringUtils 문자열 작업 - 1 보러가기(Click)
java StringUtils 문자열 작업 - 1 Method
String abbreviate ,String appendIfMissing ,String appendIfMissingIgnoreCase ,String capitalize ,String chomp ,String chomp2 ,String chop ,String center ,String center2 ,int compare ,int compareIgnoreCase ,boolean contains ,boolean containsAny ,boolean containsIgnoreCase ,boolean containsNone ,boolean containsOnly ,boolean containsWhitespace ,int countMatches ,String defaultIfBlank ,String defaultIfEmpty ,String defaultString ,String deleteWhitespace ,String difference ,boolean endsWith ,boolean endsWithAny ,boolean endsWithIgnoreCase ,boolean equals ,boolean equalsAny ,boolean equalsAnyIgnoreCase ,boolean equalsIgnoreCase ,String firstNonBlank ,String getCommonPrefix ,String getDigits ,int indexOf ,int indexOfAny ,int indexOfAnyBut ,int indexOfDifference ,int indexOfIgnoreCase
JAVA StringUtils 문자열 작업 - 2 보러가기(Click)
java StringUtils 문자열 작업 - 2 Method
boolean isAllBlank ,boolean isAllEmpty ,boolean isAllLowerCase ,boolean isAllUpperCase ,boolean isAlpha ,boolean isAlphanumeric ,boolean isAlphanumericSpace ,boolean isAlphaSpace ,boolean isAnyBlank ,boolean isAnyEmpty ,boolean isAsciiPrintable ,boolean isBlank ,boolean isEmpty ,boolean isMixedCase ,boolean isNoneBlank ,boolean isNoneEmpty ,boolean isNotBlank ,boolean isNotEmpty ,boolean isNumeric ,boolean isNumericSpace ,boolean isWhitespace ,boolean startsWith ,boolean startsWithAny ,boolean startsWithIgnoreCase ,String join ,String joinWith ,int lastIndexOf ,int lastIndexOf2 ,int lastIndexOfAny ,int lastIndexOfIgnoreCase ,int lastIndexOfIgnoreCase2 ,int lastOrdinalIndexOf ,String left ,String leftPad ,int length ,String lowerCase
JAVA StringUtils 문자열 작업 - 4 보러가기(Click)
java StringUtils 문자열 작업 - 4 Method
String[] split ,String[] split2 ,String[] splitByCharacterType ,String[] splitByCharacterTypeCamelCase ,String[] splitByWholeSeparator ,String[] splitByWholeSeparatorPreserveAllTokens ,String[] splitPreserveAllTokens ,String[] splitPreserveAllTokens2 ,String strip ,String stripAccents ,String[] stripAll ,String stripEnd ,String stripStart ,String stripToEmpty ,String stripToNull ,String substring ,String substring2 ,String substringAfter ,String substringAfterLast ,String substringBeforeLast ,String substringBetween ,String substringBetween2 ,String[] substringsBetween ,String swapCase ,int[] toCodePoints ,String trim ,String trimToEmpty ,String trimToNull ,String truncate ,String truncate2 ,String uncapitalize ,String unwrap ,String upperCase ,String wrap ,String wrapIfMissing
'개발 소발 > 개발 java(Library)' 카테고리의 다른 글
JAVA StringUtils 문자열 작업 - 4 (0) | 2018.09.07 |
---|---|
JAVA StringUtils 문자열 작업 - 2 (0) | 2018.09.04 |
JAVA StringUtils 문자열 작업 - 1 (0) | 2018.09.03 |