有些用户输入 https://google.com/
,有些用户输入 https://google.com
如何检查用户输入是否带有斜线?如果用户输入带有斜杠 如何删除斜杠?
最佳答案
var str = 'https://google.com/';
if (str.endsWith('/')) str = str.substring(0, str.length - 1);
关于dart - 删除字符串中的尾部斜杠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56145759/