我试图找到如何在 Flutter 中将文本大写,但我找不到它。
我的代码:
Center(
heightFactor: 2,
child: Text(
'Strengthening the bond of owners and pets, more than ever...',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20.0,
fontStyle: FontStyle.italic,
fontWeight: FontWeight.bold,
color: Colors.cyanAccent[700],
wordSpacing: 8,
),
)),
Run Code Online (Sandbox Code Playgroud) 这是什么类型的日期格式?
2020-03-26T00:57:08.000+08:00
Run Code Online (Sandbox Code Playgroud)
我正在使用DateFormat类
DateTime dateTime = DateTime.now();
print(dateTime.toIso8601String());
print(dateTime.toLocal());
print(dateTime.toUtc());
Run Code Online (Sandbox Code Playgroud)
输出
I/flutter (20667): 2020-03-26T01:34:20.826589
I/flutter (20667): 2020-03-26 01:34:20.826589
I/flutter (20667): 2020-03-25 17:34:20.826589Z
Run Code Online (Sandbox Code Playgroud)
我想要一个像我显示的第一个输出一样的日期格式,后面有+08:00。我应该使用哪个?
如何使用groovy删除多行注释?
/* Use groovy replaceAll regex to
remove this comment */
Run Code Online (Sandbox Code Playgroud)
我从文件,文件对象中读入上述文本,然后将其转换为字符串.如果评论跨越一行,我可以使用下面发布的replaceAll方法将其删除:
def file = new File('myfile')
def fileString = file.getText()
println fileString.replaceAll('/\\* .* \\*/','')
Run Code Online (Sandbox Code Playgroud)
我曾尝试使用(?m)标志,但我无法识别我的模式.我尝试了以下语句,但都无法匹配我的模式.
fileString.replaceAll('(?m)/\\* (.*) \\*/' ,'') #multiline switch
fileString.replaceAll('(/\\*)(.|\n\r)*(\\*/)' ,'') #match all .* (include \n\r)
Run Code Online (Sandbox Code Playgroud)
我想过使用DotAll,最后是(\ s)和$ {}.但是,我不确定如何有效地将它混合到正则表达式中.任何帮助都会受到欢迎.谢谢.