पर कनवर्ट करें, मैं एक स्ट्रिंग के पहले अक्षर को कम केस अक्षर में बदलने का तरीका ढूंढ रहा हूं। मैं जिस कोड का उपयोग कर रहा हूं वह एक सरणी से यादृच्छिक स्ट्रिंग खींचता है, स्ट्रिंग को टेक्स्ट व्यू में प्रदर्शित करता है, और उसके बाद छवि प्रदर्शित करने के लिए इसका उपयोग करता है। सरणी के सभी तारों में उनका पहला अक्षर पूंजीकृत होता है लेकिन ऐप में संग्रहीत छवि फ़ाइलों में निश्चित रूप से पूंजी अक्षरों नहीं हो सकते हैं।एंड्रॉइड: स्ट्रिंग के पहले अक्षर को
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