I have to capitalize first letter of text that i want to display. I searched for it but i cant found clear thing to do that, also there is no such props for text
in react native official documentation.
I am showing my text with following format:
<Text style={styles.title}>{item.item.title}</Text>
or
<Text style={styles.title}>{this.state.title}</Text>
How can I do it?
Suggestions are welcome?
Write a function like this
Capitalize(str){
return str.charAt(0).toUpperCase() + str.slice(1);
}
then call it from <Text>
tag By passing text as parameter
<Text>{this.Capitalize(this.state.title)} </Text>