diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-11-11 22:47:42 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-11-11 22:47:42 +0000 |
commit | e83978c06efee794faa0603c6e6653fd1647b26a (patch) | |
tree | 95314beabcdc0dceb8840d9ac524450fd15a5adb /Source/SPArrayAdditions.m | |
parent | c7b35d8ce013ad4cfd02c7ab250f5864b49980bd (diff) | |
download | sequelpro-e83978c06efee794faa0603c6e6653fd1647b26a.tar.gz sequelpro-e83978c06efee794faa0603c6e6653fd1647b26a.tar.bz2 sequelpro-e83978c06efee794faa0603c6e6653fd1647b26a.zip |
• some sequelpro://...@passToDoc/ExecuteQuery/csv improvements
Diffstat (limited to 'Source/SPArrayAdditions.m')
-rw-r--r-- | Source/SPArrayAdditions.m | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Source/SPArrayAdditions.m b/Source/SPArrayAdditions.m index 9f9e7705..66a0ce1b 100644 --- a/Source/SPArrayAdditions.m +++ b/Source/SPArrayAdditions.m @@ -70,7 +70,7 @@ if ([result length]) [result appendString:@" "]; - [result appendString:[NSString stringWithFormat:@"\"%@\"", [component stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""]]]; + [result appendFormat:@"\"%@\"", [component stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""]]; } return result; } @@ -108,6 +108,19 @@ return result; } +- (NSString *)componentsJoinedAsCSV +{ + NSMutableString *result = [NSMutableString string]; + [result setString:@""]; + + for (NSString *component in self) + { + if ([result length]) + [result appendString: @","]; + [result appendFormat:@"\"%@\"", [[component description] stringByReplacingOccurrencesOfString:@"\"" withString:@"\"\""]]; + } + return result; +} - (NSArray *)subarrayWithIndexes:(NSIndexSet *)indexes { |