aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPArrayAdditions.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-11-11 22:47:42 +0000
committerBibiko <bibiko@eva.mpg.de>2010-11-11 22:47:42 +0000
commite83978c06efee794faa0603c6e6653fd1647b26a (patch)
tree95314beabcdc0dceb8840d9ac524450fd15a5adb /Source/SPArrayAdditions.m
parentc7b35d8ce013ad4cfd02c7ab250f5864b49980bd (diff)
downloadsequelpro-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.m15
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
{