문자열의 첫 번째 문자를 소문자로 변환하는 방법을 찾고 있습니다. 사용중인 코드는 배열에서 임의의 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