endsWith方法判断字符串是否以某个字符串为结尾
例如:
fileName="testStr.zip";
//判断文件名是否以.zip结尾。endsWith可以配合toLowerCase(转为小写)使用
Boolean flag=fileName.toLowerCase().endsWith(".zip");
喜欢我的文章希望和我一起成长的宝宝们,可以搜索并添加公众号TryTestwonderful ,或者扫描下方二维码添加公众号
endsWith方法判断字符串是否以某个字符串为结尾
例如:
fileName="testStr.zip";
//判断文件名是否以.zip结尾。endsWith可以配合toLowerCase(转为小写)使用
Boolean flag=fileName.toLowerCase().endsWith(".zip");
喜欢我的文章希望和我一起成长的宝宝们,可以搜索并添加公众号TryTestwonderful ,或者扫描下方二维码添加公众号