在我的应用程序中,我有一个文本框,我需要在其中执行一些验证。并且还根据文本框中的内容之间的空间分隔它们,并将它们存储在数组中以供进一步使用。现在我想要输入是通过在使用空格分割之前将文本框全部转换为大写来提供的。我已经搜索了很多地方,但还没有找到任何东西。这是我现在的最后一个选择,请帮助。我的代码是:-
wordsInSentence = [youSaid.text componentsSeparatedByString:@" "];
我想将文本带入你说(我的文本框)大写,然后通过空格分割将它们存储到数组中。
谢谢,
克里斯蒂
In my app i have a text box and i am required to perform some validations in it .And also separating the contents present in the text box based on space between them and storing them in an array for further use.Now i want that the input is provided thorugh the text box is all converted to UPPERCASE before being split using spaces.I have already searched many places but havent found anything.This is my last option now,please help.My code is:-
wordsInSentence = [youSaid.text componentsSeparatedByString:@" "];
i want to bring the text in youSaid(my text box) in UPPERCASE and then storing them into an array by splitting with space.
Thanks,
Christy
发布评论
评论(2)
要获取大写字符串:
并且,如果您希望文本字段以大写形式显示文本(键入时),请使用 autocapitalizationType 属性。
To get the uppercase string:
And, if you want the text field to display text in upper case(while typing), use autocapitalizationType property.