如何在Flutter中使用类似于NSString的String格式?
How to use String format similar to NSString in Flutter?
如何在 Flutter 中使用这样的字符串格式?
static let sampleText = “Stack Overflow is a user-oriented question and answer site about computer programming. Located within the Stack Exchange sites, Stack Overflow was founded in 2008 by %@ and %@”
NSString(format: sampleText, Jeff Atwood, Joel Spolsky)
在 Dart 中我们有类似的字符串插值:
String name = 'John Doe';
int age = 30;
String interpolated = 'My name is $name and I\'m $age years old.';
更多示例:here
如何在 Flutter 中使用这样的字符串格式?
static let sampleText = “Stack Overflow is a user-oriented question and answer site about computer programming. Located within the Stack Exchange sites, Stack Overflow was founded in 2008 by %@ and %@”
NSString(format: sampleText, Jeff Atwood, Joel Spolsky)
在 Dart 中我们有类似的字符串插值:
String name = 'John Doe';
int age = 30;
String interpolated = 'My name is $name and I\'m $age years old.';
更多示例:here