Categories
How can a string be formatted?
Hello, I recently encountered such a problem: I would like to format a string, as in C#.
int age = 63; string a = $"you are {age} years old";
Answer the question
In order to leave comments, you need to log in
String.format("you are %s years old" , age);
int age = 63; string a = "you are " +age+ "years old";
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question