header-img
Info :
728x90

 

ํŒŒ์ผ๋กœ ๋ณด๊ธฐ๋Š” ์•„๋ž˜์—..

StringUtil.java
0.02MB

 

 

 

์•…์„ฑ์ฝ”๋“œ ็„ก only java..

 

 

 

/**
 * @Class Name : StringUtil.java
 * @Description : ๋ฌธ์ž์—ด ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ๊ด€๋ จ ์œ ํ‹ธ๋ฆฌํ‹ฐ
 * @Modification Information
 * @author ony
 **/

package com.sample.controller; // ์ด๋ฆ„ ์ž„์˜ ๋ณ€๊ฒฝํ•จ
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.security.SecureRandom;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Locale;

public class StringUtil {

    /** [1]
     *  ๋นˆ ๋ฌธ์ž์—ด ""
     *  **/
    public static final String EMPTY = "";


    /** [2]
     * Padding์„ ํ•  ์ˆ˜ ์žˆ๋Š” ์ตœ๋Œ€ ์ˆ˜์น˜
     * // private static final int PAD_LIMIT = 8192;
     * An array of Strings used for padding
     * Used for efficient space padding. The length of each String expands as needed **/
    private static final String[] PADDING = new String[Character.MAX_VALUE];

    static {
        /** space padding is most common, start with 64 chars **/
        PADDING[32]  = "                                ";
    }

    /** [3]
     * ๋ฌธ์ž์—ด์ด ์ง€์ •ํ•œ ๊ธธ์ด๋ฅผ ์ดˆ๊ณผํ•˜์˜€์„ ๋•Œ
     * ์ง€์ •ํ•œ ๊ธธ์ด๊นŒ์ง€ ์ถœ๋ ฅ + ํŠน์ • ๋ฌธ์ž์—ด์„ ๋ถ™ํ˜€์ฃผ๋Š” ๋ฉ”์„œ๋“œ
     * @param source ์›๋ณธ ๋ฌธ์ž์—ด ๋ฐฐ์—ด
     * @param output ์ถ”๊ฐ€ํ•  ๋ฌธ์ž์—ด
     * @param slength ์ง€์ • ๊ธธ์ด
     * @return ์ง€์ • ๊ธธ์ด ๋งŒํผ ์ถœ๋ ฅ ํ›„, ํŠน์ • ๋ฌธ์ž์—ด ํ•ฉ์ณ์ฃผ๋Š” ๋ฉ”์„œ๋“œ
     * **/
    public static String cutStringAdd(String source, String output, int slength){
        String returnVal = null;
        if (source != null) {
            if (source.length() > slength) {
                returnVal = source.substring(0, slength) + output;
            } else
                returnVal = source;
        }
        return returnVal;
    }

    /** [4]
     * ๋ฌธ์ž์—ด์ด ์ง€์ •ํ•œ ๊ธธ์ด๋ฅผ ์ดˆ๊ณผํ•œ ๊ฒฝ์šฐ, ์ดˆ๊ณผํ•œ ๋ฌธ์ž์—ด์„ ์‚ญ์ œํ•˜๋Š” ๋ฉ”์„œ๋“œ
     * @param source ์›๋ณธ ๋ฌธ์ž์—ด ๋ฐฐ์—ด
     * @param slength ์ง€์ • ๊ธธ์ด
     * @return ์ง€์ • ๊ธธ์ด ๋งŒํผ ๋ฌธ์ž์—ด ์ž๋ฆ„
     * **/
    public static String cutString(String source, int slength){
        String result = null;
        if (source != null) {
            if (source.length() > slength) {
                result = source.substring(0, slength);
            } else
                result = source;
        }
        return result;
    }

    /** [5]
     * ๋ฌธ์ž์—ด ๊ฒ€์ฆ: String์ด ๋น„์—ˆ๊ฑฐ๋‚˜("") null์ธ์ง€ ๊ฒ€์ฆ
     *
     * in case)
     * "", null = true
     * " ", "string", " string " = false
     *
     * @param str ์ฒดํฌ ๋Œ€์ƒ String Object์ด๋ฉฐ null ํ—ˆ์šฉ
     * @return ์ž…๋ ฅ๋ฐ›์€ ๋ฌธ์ž์—ด์ด ๋นˆ ๋ฌธ์ž์—ด์ด๊ฑฐ๋‚˜ null์ธ ๊ฒฝ์šฐ true ๋ฐฐ์ถœ
     * **/
    public static boolean isEmpty(String str){
        return str == null || str.length() == 0;
    }

    /** [6]
     * ๋ฌธ์ž์—ด์— ํฌํ•จ๋œ ๋ชจ๋“  ๋Œ€์ƒ ๋ฌธ์ž(char) ์ œ๊ฑฐ
     *
     * in case)
     * StringUtil.remove("test",'t') = "es"
     *
     * @param str ๊ธฐ์ค€ ๋ฌธ์ž์—ด
     * @param remove ์ž…๋ ฅ๋ฐ›์€ ๋ฌธ์ž์—ด์—์„œ ์ œ๊ฑฐํ•  ๋Œ€์ƒ ๋ฌธ์ž์—ด
     * @return ์ œ๊ฑฐํ•  ๋Œ€์ƒ์ด ์ œ๊ฑฐ๋œ ๋ฌธ์ž์—ด.
     * **/
    public static String remove(String str, char remove){
        if(isEmpty(str) || str.indexOf(remove) == -1){
            return str;
        }
        char[] chars = str.toCharArray();
        int pos = 0;
        for (int i = 0; i < chars.length; i++) {
            if (chars[i] != remove) {
                chars[pos++] = chars[i];
            }
        }
        return new String(chars, 0, pos);
    }

    /** [7]
     * ๋ฌธ์ž์—ด ๋‚ด๋ถ€์˜ ์ฝค๋งˆ character(,)์„ ์ œ๊ฑฐ - 6๋ฒˆ func ์‚ฌ์šฉ
     *
     * in case)
     * StringUtil.removeCommaChar("hi,hello,goodmorning") = "hihellogoodmorning"
     *
     * @param str ๋ฌธ์ž์—ด
     * @return ","(์ฝค๋งˆ) ๊ฐ€ ์ œ๊ฑฐ๋œ str
     * **/
    public static String removeCommaChar(String str){
        return remove(str, ',');
        // -, / ๋“ฑ๋“ฑ ํ™œ์šฉ ๊ฐ€๋Šฅ์„ฑ์„ ์œ„ํ•œ ์˜ˆ์ œ
    }

    /** [8]
     * ์›๋ณธ ๋ฌธ์ž์—ด์— ํฌํ•จ๋œ ํŠน์ • ๋ฌธ์ž์—ด์„ ์ƒˆ๋กœ์šด ๋ฌธ์ž์—ด๋กœ ์น˜ํ™˜
     *
     * @param source ์›๋ณธ ๋ฌธ์ž์—ด
     * @param subject ๋ณ€ํ™˜ ์‹œํ‚ฌ ๋ฌธ์ž์—ด
     * @param object ๋ณ€ํ™˜ ํ…์ŠคํŠธ
     * @return ์น˜ํ™˜ ์™„๋ฃŒ๋œ ๋ฌธ์ž์—ด
     * **/
    public static String replace(String source, String subject, String object) {
        StringBuffer rtnStr = new StringBuffer();
        String preStr = "";
        String nextStr = source;
        String srcStr = source;

        while (srcStr.indexOf(subject) >= 0) {
            preStr = srcStr.substring(0, srcStr.indexOf(subject));
            nextStr = srcStr.substring(srcStr.indexOf(subject) + subject.length(), srcStr.length());
            srcStr = nextStr;
            rtnStr.append(preStr).append(object);
        }

        rtnStr.append(nextStr);

        return rtnStr.toString();
    }

    /** [9]
     * ์›๋ณธ ๋ฌธ์ž์—ด์— ํฌํ•จ๋œ ํŠน์ • ๋ฌธ์ž์—ด ์ฒซ๋ฒˆ์งธ ํ•œ ๊ฐœ ๋งŒ์„ ์ƒˆ๋กœ์šด ๋ฌธ์ž์—ด๋กœ ์น˜ํ™˜
     *
     * @param source ์›๋ณธ ๋ฌธ์ž์—ด
     * @param subject ๋ณ€ํ™˜ ์‹œํ‚ฌ ๋ฌธ์ž์—ด
     * @param object ๋ณ€ํ™˜ ํ…์ŠคํŠธ
     * @return ์น˜ํ™˜ ์™„๋ฃŒ๋œ ๋ฌธ์ž์—ด
     *
     * source์— subject๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ๋Š” ์›๋ณธ source ์ œ์ถœ
     * **/
    public static String replaceOnce(String source, String subject, String object) {
        StringBuffer rtnStr = new StringBuffer();
        String preStr = "";
        String nextStr = source;

        if (source.indexOf(subject) >= 0) {
            preStr = source.substring(0, source.indexOf(subject));
            nextStr = source.substring(source.indexOf(subject) + subject.length(), source.length());
            rtnStr.append(preStr).append(object).append(nextStr);
            return rtnStr.toString();
        } else {
            return source;
        }
    }

    /** [10]
     * str ์ค‘ searchStr์˜ ์‹œ์ž‘ ์œ„์น˜๋ฅผ ๋ฐ˜ํ™˜
     * (์ž…๋ ฅ ๊ฐ’ ์ค‘ null์ด ์žˆ๋Š” ๊ฒฝ์šฐ/searchStr์ด ์—†๋Š” ๊ฒฝ์šฐ -1์„ ๋ฐ˜ํ™˜)
     *
     * @param str ๊ฒ€์ƒ‰ ๋ฌธ์ž์—ด
     * @param searchStr ๊ฒ€์ƒ‰ ๋Œ€์ƒ ๋ฌธ์ž์—ด
     * @return searchStr์˜ ์œ„์น˜ index
     * **/
    public static int indexOf(String str, String searchStr) {

        if (str == null || searchStr == null)
        {
            return -1;
        }

        return str.indexOf(searchStr);
    }

    /** [11]
     * ๊ฐ์ฒด๊ฐ€ null์ธ์ง€ ํ™•์ธํ•˜๊ณ  null์ธ ๊ฒฝ์šฐ ""๋กœ ๋ณ€๊ฒฝํ•˜๋Š” ๋ฉ”์„œ๋“œ
     *
     * @param object ์›๋ณธ ๊ฐ์ฒด
     * @return resultVal ๋ฌธ์ž์—ด
     * **/
    public static String isNullToString(Object object) {
        String string = "";

        if (object != null) {
            string = object.toString().trim();
        }

        return string;
    }

    /** [12]
     * ๋ฌธ์ž์—ด์—์„œ {@link Character#isWhitespace(char)}์— ์ •์˜๋œ
     * ๋ชจ๋“  ๊ณต๋ฐฑ๋ฌธ์ž ์ œ๊ฑฐ
     *
     * in case)
     * StringUtil.removeWhitespace(null) = null
     * StringUtil.removeWhitespace(" a b c    ") = "abc"
     *
     * @param str ๊ณต๋ฐฑ๋ฌธ์ž๋ฅผ ์ œ๊ฑฐํ•  ๋ฌธ์ž์—ด
     * @return ๊ณต๋ฐฑ๋ฌธ์ž๊ฐ€ ์ œ๊ฑฐ๋œ ๋ฌธ์ž์—ด.
     * **/
    public static String removeWhitespace(String str) {

        if (isEmpty(str)) {
            return str;
        }

        int sz = str.length();
        char[] chs = new char[sz];
        int count = 0;

        for (int i = 0; i < sz; i++) {
            if (!Character.isWhitespace(str.charAt(i))) {
                chs[count++] = str.charAt(i);
            }
        }

        if (count == sz) {
            return str;
        }

        return new String(chs, 0, count);
    }

    /** [13]
     * HTML ์ฝ”๋“œ๊ฐ€ ๋“ค์–ด๊ฐ„ ๋ฌธ์„œ๋ฅผ ํ‘œ์‹œํ•˜๋Š” ๊ฒฝ์šฐ ํƒœ๊ทธ์— ์†์ƒ์„ ๋ง‰์•„์ฃผ๋Š” ๋ฉ”์„œ๋“œ
     *
     * @param strString ์ฒดํฌ ๋Œ€์ƒ ๋ฌธ์ž์—ด
     * @return HTML ํƒœ๊ทธ๋ฅผ ์น˜ํ™˜ํ•œ ๋ฌธ์ž์—ด
     * **/
    public static String checkHtmlView(String strString) {
        String strNew = "";
        StringBuffer strTxt = new StringBuffer("");
        char chrBuff;
        int len = strString.length();

        for (int i = 0; i < len; i++) {
            chrBuff = (char) strString.charAt(i);
            switch (chrBuff) {
                case '<':
                    strTxt.append("&lt;");
                    break;
                case '>':
                    strTxt.append("&gt;");
                    break;
                case '"':
                    strTxt.append("&quot;");
                    break;
                case 10:
                    strTxt.append("<br>");
                    break;
                case ' ':
                    strTxt.append("&nbsp;");
                    break;
                default:
                    strTxt.append(chrBuff);
            }
        }

        strNew = strTxt.toString();

        return strNew;
    }

    /** [14]
     * ๋ฌธ์ž์—ด์„ ์ง€์ •ํ•œ ๋ถ„๋ฆฌ์ž๋กœ ๋ถ„๋ฆฌํ•˜์—ฌ ๋ฐฐ์—ด๋กœ ๋ฆฌํ„ดํ•˜๋Š” ๋ฉ”์„œ๋“œ
     *
     * @param source ์›๋ณธ ๋ฌธ์ž์—ด
     * @param separator ๋ถ„๋ฆฌ์ž
     * @return ๋ถ„๋ฆฌ์ž๋กœ ๋‚˜๋ˆ„์–ด์ง„ ๋ฌธ์ž์—ด ๋ฐฐ์—ด
     * **/
    public static String[] split(String source, String separator) throws NullPointerException {
        String[] returnVal = null;
        int cnt = 1;
        int index = source.indexOf(separator);
        int index0 = 0;

        while (index >= 0) {
            cnt++;
            index = source.indexOf(separator, index + 1);
        }

        returnVal = new String[cnt];
        cnt = 0;
        index = source.indexOf(separator);

        while (index >= 0) {
            returnVal[cnt] = source.substring(index0, index);
            index0 = index + 1;
            index = source.indexOf(separator, index + 1);
            cnt++;
        }

        returnVal[cnt] = source.substring(index0);

        return returnVal;
    }

    /** [15]
     * {@link String#toLowerCase()}๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์†Œ๋ฌธ์ž ๋ณ€ํ™˜
     *
     * @param str ์†Œ๋ฌธ์ž๋กœ ๋ณ€ํ™˜์‹œํ‚ฌ ๋ฌธ์ž์—ด
     * @return ์†Œ๋ฌธ์ž๋กœ ๋ณ€ํ™˜๋œ ๋ฌธ์ž์—ด. null ์ž…๋ ฅ์‹œ null ๋ฆฌํ„ด
     * **/
    public static String lowerCase(String str) {
        if (str == null) {
            return null;
        }

        return str.toLowerCase();
    }

    /** [16]
     * {@link String#toUpperCase()}๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋Œ€๋ฌธ์ž ๋ณ€ํ™˜
     *
     * @param str ๋Œ€๋ฌธ์ž๋กœ ๋ณ€ํ™˜์‹œํ‚ฌ ๋ฌธ์ž์—ด
     * @return ๋Œ€๋ฌธ์ž๋กœ ๋ณ€ํ™˜๋œ ๋ฌธ์ž์—ด. null ์ž…๋ ฅ์‹œ null ๋ฆฌํ„ด
     * **/
    public static String upperCase(String str) {
        if (str == null) {
            return null;
        }

        return str.toUpperCase();
    }

    /** [17]
     * ์ž…๋ ฅ๋œ string์˜ ์•ž ์ชฝ์—์„œ ์ธ์ž๋กœ ์ „๋‹ฌ๋œ ๋ฌธ์ž๋ฅผ ๋ชจ๋‘ ์ œ๊ฑฐํ•˜๋Š” ๋ฉ”์„œ๋“œ
     *
     * in case)
     * StringUtil.stripStart("abcd  ","cat") = "bd  "
     *
     * @param str ๊ธฐ์ค€ ๋ฌธ์ž์—ด
     * @param stripChars ์ œ๊ฑฐ ๋Œ€์ƒ ๋ฌธ์ž์—ด
     * @return ์ง€์ •๋œ ๋ฌธ์ž๊ฐ€ ์ œ๊ฑฐ๋œ ๊ธฐ์ค€ ๋ฌธ์ž์—ด. null ์ž…๋ ฅ ์‹œ null ๋ฆฌํ„ด
     * **/
    public static String stripStart(String str, String stripChars) {
        int strLen;

        if (str == null || (strLen = str.length()) == 0)
        {
            return str;
        }

        int start = 0;
        if (stripChars == null) {
            while ((start != strLen) && Character.isWhitespace(str.charAt(start)))
            {
                start++;
            }
        }
        else if (stripChars.length() == 0) {
            return str;
        }
        else {
            while ((start != strLen) && (stripChars.indexOf(str.charAt(start)) != -1))
            {
                start++;
            }
        }

        return str.substring(start);
    }

    /** [18]
     * ์ž…๋ ฅ๋œ string์˜ ๋’ท ์ชฝ์—์„œ ์ธ์ž๋กœ ์ „๋‹ฌ๋œ ๋ฌธ์ž๋ฅผ ๋ชจ๋‘ ์ œ๊ฑฐํ•˜๋Š” ๋ฉ”์„œ๋“œ
     *
     * in case)
     * StringUtil.stripStart("  abcd","cat") = "  bd"
     *
     * @param str ๊ธฐ์ค€ ๋ฌธ์ž์—ด
     * @param stripChars ์ œ๊ฑฐ ๋Œ€์ƒ ๋ฌธ์ž์—ด
     * @return ์ง€์ •๋œ ๋ฌธ์ž๊ฐ€ ์ œ๊ฑฐ๋œ ๊ธฐ์ค€ ๋ฌธ์ž์—ด. null ์ž…๋ ฅ ์‹œ null ๋ฆฌํ„ด
     * **/
    public static String stripEnd(String str, String stripChars) {
        int end;
        if (str == null || (end = str.length()) == 0) {
            return str;
        }

        if (stripChars == null) {
            while ((end != 0) && Character.isWhitespace(str.charAt(end - 1))) {
                end--;
            }
        } else if (stripChars.length() == 0) {
            return str;
        } else {
            while ((end != 0) && (stripChars.indexOf(str.charAt(end - 1)) != -1)) {
                end--;
            }
        }

        return str.substring(0, end);
    }

    /** [19]
     * ์ž…๋ ฅ๋œ string์˜ ์–‘ ๋ฐฉํ–ฅ์—์„œ ์ธ์ž๋กœ ์ „๋‹ฌ๋œ ๋ฌธ์ž๋ฅผ ๋ชจ๋‘ ์ œ๊ฑฐํ•˜๋Š” ๋ฉ”์„œ๋“œ
     *
     * @param str ๊ธฐ์ค€ ๋ฌธ์ž์—ด
     * @param stripChars ์ œ๊ฑฐ ๋Œ€์ƒ ๋ฌธ์ž์—ด
     * @return ์ง€์ •๋œ ๋ฌธ์ž๊ฐ€ ์ œ๊ฑฐ๋œ ๊ธฐ์ค€ ๋ฌธ์ž์—ด. null ์ž…๋ ฅ ์‹œ null ๋ฆฌํ„ด
     * **/
    public static String strip(String str, String stripChars) {
        if (isEmpty(str)) {
            return str;
        }

        String srcStr = str;
        srcStr = stripStart(srcStr, stripChars);

        return stripEnd(srcStr, stripChars);
    }

    /** [20]
     * ๋ฌธ์ž์—ด A~Z ์‚ฌ์ด์˜ ๋žœ๋ค ๋ฌธ์ž์—ด์„ ๊ตฌํ•˜๋Š” ๊ธฐ๋Šฅ
     * (์‹œ์ž‘ ๋ฌธ์ž์—ด, ์ข…๋ฃŒ ๋ฌธ์ž์—ด ์ง€์ • ๊ฐ€๋Šฅ)
     *
     * @param startChr ์ฒซ ๋ฌธ์ž
     * @param endChr ๋งˆ์ง€๋ง‰ ๋ฌธ์ž
     * @exception
     * @return ์ฒซ ๋ฌธ์ž์™€ ๋งˆ์ง€๋ง‰ ๋ฌธ์ž ์‚ฌ์ด์˜ ๋žœ๋ค ๋ฌธ์ž
     * **/
    public static String getRandomStr(char startChr, char endChr) {
        int randomInt;
        String randomStr = null;
        // ์‹œ์ž‘ ๋ฌธ์ž ์™€ ์ข…๋ฃŒ ๋ฌธ์ž ์•„์Šคํ‚ค์ˆซ์ž๋กœ ๋ณ€ํ™˜
        int startInt = Integer.valueOf(startChr);
        int endInt = Integer.valueOf(endChr);
        // ์‹œ์ž‘ ๋ฌธ์ž๊ฐ€ ์ข…๋ฃŒ ๋ฌธ์ž๋ณด๋‹ค ํด ๊ฒฝ์šฐ exception ๋ฐœ์ƒ
        if (startInt > endInt) {
            throw new IllegalArgumentException("Start String: " + startChr + " End String: " + endChr);
        }
        // ๋žœ๋ค ๊ฐ์ฒด ์ƒ์„ฑ
        SecureRandom rnd = new SecureRandom();
        do {
            // ์‹œ์ž‘ ๋ฌธ์ž ์™€ ์ข…๋ฃŒ๋ฌธ์ž ์‚ฌ์ด์—์„œ ๋žœ๋ค ์ˆซ์ž ๋ฐœ์ƒ
            randomInt = rnd.nextInt(endInt + 1);
        } while (randomInt < startInt);
        // ์ž…๋ ฅ ๋ฐ›์€ ๋ฌธ์ž 'A'(65)๋ณด๋‹ค ์ž‘์œผ๋ฉด ๋‹ค์‹œ ๋žœ๋ค ์ˆซ์ž ๋ฐœ์ƒ.
        // ๋žœ๋ค ์ˆซ์ž๋ฅผ ๋ฌธ์ž๋กœ ๋ณ€ํ™˜ ํ›„ String ์œผ๋กœ ์žฌ๋ณ€ํ™˜

        randomStr = (char) randomInt + "";
        return randomStr;
    }

    /** [21]
     * ๋‚ ์งœ ํ˜•์‹ ๋ฌธ์ž์—ด ๋‚ด๋ถ€์— ๋งˆ์ด๋„ˆ์Šค char(-) ์ถ”๊ฐ€
     *
     * in case)
     * StringUtil.addMinusChar("20231227") = "2023-12-27"
     *
     * @param date ์ž…๋ ฅ ๋ฌธ์ž์—ด
     * @return "-"๊ฐ€ ์ถ”๊ฐ€๋œ ์ž…๋ ฅ ๋ฌธ์ž์—ด
     * **/
    public static String addMinusChar(String date) {
        if (date.length() == 8)
            return date.substring(0, 4).concat("-").concat(date.substring(4, 6)).concat("-").concat(date.substring(6, 8));
        else
            return "";
    }

    /** [22]
     * ์‘์šฉ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ๊ณ ์œ ๊ฐ’ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด
     * ์‹œ์Šคํ…œ์—์„œ 17์ž๋ฆฌ์˜ timestamp ๊ฐ’ ๊ตฌํ•˜๋Š” ๋ฉ”์„œ๋“œ
     *
     * @return timestamp ๊ฐ’
     * @exception
     * **/
    public static String getTimeStamp() {
        String rtnStr = null;

        // ๋ฌธ์ž์—ด๋กœ ๋ณ€ํ™˜ํ•˜๊ธฐ ์œ„ํ•œ ํŒจํ„ด ์„ค์ •(๋…„๋„-์›”-์ผ ์‹œ:๋ถ„:์ดˆ:์ดˆ(์ž์ •์ดํ›„ ์ดˆ))
        String pattern = "yyyyMMddhhmmssSSS";
        SimpleDateFormat sdfCurrent = new SimpleDateFormat(pattern, Locale.KOREA);
        Timestamp ts = new Timestamp(System.currentTimeMillis());
        rtnStr = sdfCurrent.format(ts.getTime());

        return rtnStr;
    }

}

 

 

๋…ธ๊ฐ€๋‹ค String Util ๋ชจ์Œ์ง‘... ๊บผ๋‚ด์“ฐ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค...

์ •์‹  ๊ฑด๊ฐ•์— ๋„์›€์ด ๋˜๊ธธ ๋ฐ”๋ผ๋ฉฐ...

 

ํ–‰๋ณตํ•˜์„ธ์š” ^^...

728x90
๋”๋ณด๊ธฐ
BACKEND/SpringBoot