stringByAppendingPathComponent及他的删除函数 等系列函数
2015-03-19 16:12
381 查看
- (NSString *)stringByAppendingPathComponent:(NSString *)aString
aString is“
scratch.tiff”:
Receiver’s String Value | Resulting String |
---|---|
“/tmp” | “/tmp/scratch.tiff” |
“/tmp/” | “/tmp/scratch.tiff” |
“/” | “/scratch.tiff” |
“” (an empty string) | “scratch.tiff” |
Receiver’s String Value | Resulting String |
---|---|
“/tmp /scratch.tiff” | “/tmp” |
“/tmp/lock/” | “/tmp” |
“/tmp/” | “/” |
“/tmp” | “/” |
“/” | “/” |
“scratch.tiff” | “” (an empty string) |
"
tiff
"
Receiver’s String Value | Resulting String |
---|---|
“/tmp/scratch.old” | “/tmp/scratch.old.tiff” |
“/tmp/scratch.” | “/tmp/scratch..tiff” |
“/tmp/” | “/tmp.tiff” |
“scratch” | “scratch.tiff” |
(NSString *)stringByDeletingPathExtension
Receiver’s String Value | Resulting String |
---|---|
“/tmp/scratch.tiff” | “/tmp/scratch” |
“/tmp/” | “/tmp” |
“scratch.bundle/” | “scratch” |
“scratch..tiff” | “scratch.” |
“.tiff” | “.tiff” |
“/” | “/” |
aString
The string to append to the receiver. This value must not be
nil.
NSString *errorTag = @"Error: "; |
NSString *errorString = @"premature end of file."; |
NSString *errorMessage = [errorTag stringByAppendingString:errorString]; |
“
Error:
premature end of file.”.
相关文章推荐
- stringByAppendingPathComponent和stringByAppendingString的区别
- stringByAppendingPathComponent和stringByAppendingString的区别
- stringByAppendingPathComponent和stringByAppendingString的区别
- [C/C++标准库]_[初级]_[构造文件路径(stringByAppendingPathComponent)]
- StringByAppendingPathComponent和stringByAppendingString的区别
- iOS字符串拼接 stringByAppendingString:与 stringByAppendingPathComponent:
- stringByAppendingPathComponent与stringByAppendingString区别
- stringByAppendingPathComponent和stringByAppendingString的区别
- stringByAppendingPathComponent、stringByAppendingString等语句的区别
- stringByAppendingPathComponent和stringByAppendingString的区别
- stringByAppendingPathComponent和stringByAppendingString的区别
- stringByAppendingString和stringByAppendingPathComponent
- stringByAppendingPathComponent和stringByAppendingString 的区别
- stringByAppendingString, stringByAppendingPathComponent, stringByAppendingPathExtension
- stringByAppendingPathComponent和stringByAppendingString的区别
- iOS中stringByAppendingString 和 stringByAppendingPathComponent 的区别
- stringByAppendingPathComponent和stringByAppendingString的区别
- [C/C++标准库]_[初级]_[构造文件路径(stringByAppendingPathComponent)]
- stringByAppendingPathComponent和stringByAppendingString的区别
- stringByAppendingPathComponent和stringByAppendingPathExtension区别