About 447,000 results
Open links in new tab
  1. String replacement in java, similar to a velocity template

    Is there any String replacement mechanism in Java, where I can pass objects with a text, and it replaces the string as it occurs? For example, the text is: Hello ${user.name}, Welcome to …

  2. java - Why is String template not available - Stack Overflow

    Sep 19, 2024 · The string template was a preview feature in Java 21 and Java 22, and has been withdrawn for further redesign. In other words, this feature never existed in mainline Java (you …

  3. How to format strings in Java - Stack Overflow

    Primitive question, but how do I format strings like this: "Step {1} of {2}" by substituting variables using Java? In C# it's easy.

  4. Java string templatizer / formatter with named arguments

    Mar 29, 2017 · I'm aware of: String.format Formatter MessageFormat but all of them use ordered or at least numbered arguments, not named ones. I know it's trivial to implement one, but is …

  5. Simple way templating multiline strings in java code

    Jan 20, 2014 · Java 21 (releasing September 2023) is introducing a string templating syntax as a preview feature. This is JEP 430. A preview feature means that all Java 21 JDKs must include …

  6. java - Named placeholders in string formatting - Stack Overflow

    Feb 18, 2010 · Java's string templates are more versatile, and much safer, than features in other languagues such as C#'s string interpolation and Python's f-strings. For example, string …

  7. String variable interpolation Java - Stack Overflow

    String templates are much more powerful than traditional string interpolations in C#, Perl, or Python. String templates have built-in string processors (STR and FMT) and also allow to …

  8. Java generating Strings with placeholders - Stack Overflow

    Does this answer your question? String replacement in java, similar to a velocity template

  9. templates - How to use Class<T> in Java? - Stack Overflow

    Shape<Integer> s1 = new Shape(); Shape<String> s2 = new Shape(); Integer is a type and String is also a type. <T> specifically stands for generic type. According to Java Docs - A generic …

  10. java - How to use String as Velocity Template? - Stack Overflow

    Sep 16, 2009 · I changed to the following solution, and everything works fine now: Velocity template as a String in Java. It uses Velocity#evaluate (context, out, logTag, instring), as …