如何在目标c中拆分字符串 [英] how to split strings in objective c
本文介绍了如何在目标c中拆分字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Objective-C中拆分字符串?我正在开发一个包含日期选择器的简短应用程序。我显示日期从日期选择器获取它并通过标签显示它。
How to split a string in objective-C? I am working on an short application that contains a date picker. I do display date get it from date picker and display it through a label.
我的主要问题是如何将日期拆分为三个单独的字符串?
任何人都有这个想法?
My main question is that how can I split the the date in to three separate strings? any one has idea about it?
谢谢
推荐答案
您可以使用 - [NSString componentsSeparatedByString:]
或 NSScanner
分割字符串,或使用 NSCalendar
提取您感兴趣的日期。
You could use -[NSString componentsSeparatedByString:]
or NSScanner
to split the string, or use NSCalendar
to extract the pieces of the date you're interested in.
这篇关于如何在目标c中拆分字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文