aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPArrayAdditions.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPArrayAdditions.m')
-rw-r--r--Source/SPArrayAdditions.m15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/SPArrayAdditions.m b/Source/SPArrayAdditions.m
index 7cc5bb4e..9f9e7705 100644
--- a/Source/SPArrayAdditions.m
+++ b/Source/SPArrayAdditions.m
@@ -60,6 +60,21 @@
return result;
}
+- (NSString *)componentsJoinedBySpacesAndQuoted
+{
+ NSMutableString *result = [NSMutableString string];
+ [result setString:@""];
+
+ for (NSString *component in self)
+ {
+ if ([result length])
+ [result appendString:@" "];
+
+ [result appendString:[NSString stringWithFormat:@"\"%@\"", [component stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""]]];
+ }
+ return result;
+}
+
- (NSString *)componentsJoinedByPeriodAndBacktickQuoted
{
NSMutableString *result = [NSMutableString string];