Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StrFormatter问题 #3428

Closed
GreenCypress opened this issue Dec 14, 2023 · 1 comment
Closed

StrFormatter问题 #3428

GreenCypress opened this issue Dec 14, 2023 · 1 comment

Comments

@GreenCypress
Copy link

版本情况

JDK版本: openjdk_11
hutool版本: 5.8.23(请确保最新尝试是否还有问题)

问题描述(包括截图)

  1. 复现代码
        String result1 = StrFormatter.format("this is {} for {}", "a", "b");
        String result2 = StrFormatter.format("当{}天内没有完成守护任务,系统会自动为对方送出{} * 1,维持守护关系生效","1", "2");
        System.out.println(result1);
        System.out.println(result2);
        // result 1 :   this is a for b
        // result 2 :  当1天内没有完成守护任务,系统会自动为对方送出{} * 1,维持守护关系生效

result2 的参数2未正确替换。

@GreenCypress
Copy link
Author

好吧 占位符问题 {}和{}宽度不一致。。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant