Question by
hwaniwow · Jan 10, 2017 at 09:25 AM ·
textinputfield
Can`t convert text to upper case from Text of InputField
When typing on inputfield, i wish Text component shows alphavet to Upper case, So, I used "someString.ToUpper()" method. into text.text = someString
but text component never change to upper case. I guess , text Component has some element which is change case i can`t find.
how can i solve this problem?
Someone, who solve this problem, also face this too, please reply, thanks alot.
which is code
Class {
public void checkCode(){
InputField _field = inputObj.GetComponent<InputField> ();
_field.characterLimit = 16;
Text _txt = txtObj.GetComponent<Text> ();
Text _txtCom = txtComment.GetComponent<Text>();
string tmpString = _txt.text;
tmpString = tmpString.ToUpper ();
Debug.Log ("inputField Text : " + tmpString);
Debug.Log ("text obj name : " + _field.textComponent.name);
_field.textComponent.text = tmpString;
if (_txt.text.Length < 5) {
_txtCom.text = "Invalid Code. Input again";
//Debug.Log ("Input 6 letters Code");
} else {
_txtCom.text = "Press Ok Button";
}
}
}
Comment