StringFormaterUtils.java 449 Bytes
Newer Older
xieshaojun's avatar
xieshaojun committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
package vc.thinker.utils;

import org.slf4j.helpers.MessageFormatter;

/**
 * @author : xieshaojun
 * @date : 2023/1/3 17:54
 */
public class StringFormaterUtils {

    /**
     * 用{}作为占位符,格式化字符串
     *
     * @param format
     * @param argArray
     * @return
     */
    public static String format(String format, Object... argArray) {
        return MessageFormatter.arrayFormat(format, argArray).getMessage();
    }
}