小编tfm*_*gue的帖子

如何在 Flutter 中将文本大写

我试图找到如何在 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)

text flutter

10
推荐指数
2
解决办法
3万
查看次数

如何使用 UTC 时区偏移格式化 DateTime?

这是什么类型的日期格式?

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。我应该使用哪个?

datetime dart flutter

5
推荐指数
2
解决办法
2万
查看次数

Groovy删除多行注释

如何使用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)和$ {}.但是,我不确定如何有效地将它混合到正则表达式中.任何帮助都会受到欢迎.谢谢.

regex groovy comments multiline replaceall

2
推荐指数
1
解决办法
4139
查看次数

标签 统计

flutter ×2

comments ×1

dart ×1

datetime ×1

groovy ×1

multiline ×1

regex ×1

replaceall ×1

text ×1