Tnx提前帮助。我想将我的点文件扩展名从大写字母转换为小写字母。例如:ABCD.JPG >> ABCD.jpg,xyz.PNG >> xyz.pngAndroid:将.extensions转换为下/大写
if (attachemtnDescription.toString().endsWith(".JPG") || attachemtnDescription.toString().endsWith(".jpg")) {
attachmentPreviewImg.setImageResource(R.drawable.ic_support_attachment_image);
因为我有很多的附件类型申报的,所以它的忙乱到两个申报各类附件大写和小写,所以我想减少我的代码。
我有一种方法来转换上/下转换,但如何实现相同的 ...请帮助相同。
EditText edit = (EditText)findViewById(R.id.email);
String input;
input = edit.getText().toString();
input = input.toLowerCase(); //converts the string to lowercase
or
input = input.toUpperCase();
这可能会帮助您重命名。 stackoverflow.com/a/2896829/1977021 – invisbo