String Formatter in GWT

前端 未结 12 867
生来不讨喜
生来不讨喜 2021-02-03 18:59

How do I format my string in GWT?

I made a method

  Formatter format = new Formatter();
    int matches = 0;
    Formatter formattedString = format.forma         


        
12条回答
  •  旧巷少年郎
    2021-02-03 20:00

    Maybe the easiest way to do something like String.format, can be do it with a String.replace, for instance;

    instead of do String.format("Hello %s", "Daniel"); ==> "Hello %s".replace("%s", "Daniel"),

    both give us the same result, but just the second way works in GWT client side

提交回复
热议问题