文字列の最初の文字を小文字に変換する方法を探しています。使用しているコードは、配列からランダムなStringを取り出し、その文字列をテキストビューに表示し、それを使用して画像を表示します。配列内のすべての文字列は最初の文字が大文字になりますが、アプリに格納されている画像ファイルには大文字を使用できません。Android:文字列の最初の文字を小文字に変換する
String source = "drawable/"
//monb is randomly selected from an array, not hardcoded as it is here
String monb = "Picture";
//I need code here that will take monb and convert it from "Picture" to "picture"
String uri = source + monb;
int imageResource = getResources().getIdentifier(uri, null, getPackageName());
ImageView imageView = (ImageView) findViewById(R.id.monpic);
Drawable image = getResources().getDrawable(imageResource);
imageView.setImageDrawable(image);
ありがとうございます!
シンプルで効果的!ありがとう – cerealspiller