我的密钥值为:2016-01-13 04:02:20。但只有我想在我的UILabel文本中只显示2016-01-13。怎么做到这一点?有没有办法缩短钥匙的时间?
答案 0 :(得分:0)
只需你可以这样做,
<div class="container">
<div id="mockTextBox">
What's Happening ?
</div></br>
<textarea id="originalTextBox" class="form-control">
</textarea>
</div>
输出:
答案 1 :(得分:0)
尝试以下:
NSString *YourString = @"2016-01-13 04:02:20";
YourString=[YourString substringToIndex:10];
OR
NSString *YourString = @"2016-01-13 04:02:20";
[YourString substringWithRange: NSMakeRange(0, [YourString rangeOfString:@" "].location)];
OR
NSArray *arrSepValue;
NSString *YourString = @"2016-01-13 04:02:20";
arrSepValue = [YourString componentsSeparatedByString:@" "];
NSString *DateStr=[arrSepValue objectAtIndex:0];