在Java ME中,我需要做一个简单的字符串替换: String.format("This string contains placeholders %s %s %s", "first", "second", "third")
;
占位符不必是字符串的结尾:Java ME:格式化字符串最简单的方法是什么?
String.format ("Your name is %s and you are %s years old", "Mark", "18");
但是,据我所看到的,String.format
方法不是在J2ME中使用。什么是替代这个?如何在不编写自己的函数的情况下实现简单的字符串格式化?
thanx,我结束了使用我自己的功能,但thanx无论如何。 – Maggie