我们经常遇到这种情况,字符串值以空格开头。如何检查并返回以空格开头的所有字符串?
我发现了一个类似的问题:Velocity, what's the most efficient way to check if a string is empty and not null
但我不知道怎么做,因为我从来没有做过任何事情的速度。
发布于 2018-04-05 11:10:34
请不要忘记,您可以在速比引用上调用Java方法。所以没有什么能阻止你去做:
#foreach($str in $myStrings)
#if($str.startsWith(' '))
## do something with $str
#end
#endhttps://stackoverflow.com/questions/49646209
复制相似问题