Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java use variables inside strings

Java 15+
String foo = "foo";
String bar = "bar";

String str = "First %s, then %s".formatted(foo, bar);     
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #variables #strings
ADD COMMENT
Topic
Name
7+3 =