@@ -669,47 +669,6 @@ extension StringProtocol {
669
669
return _ns. canBeConverted ( to: encoding. rawValue)
670
670
}
671
671
672
- // @property NSString* capitalizedString
673
-
674
- /// A copy of the string with each word changed to its corresponding
675
- /// capitalized spelling.
676
- ///
677
- /// This property performs the canonical (non-localized) mapping. It is
678
- /// suitable for programming operations that require stable results not
679
- /// depending on the current locale.
680
- ///
681
- /// A capitalized string is a string with the first character in each word
682
- /// changed to its corresponding uppercase value, and all remaining
683
- /// characters set to their corresponding lowercase values. A "word" is any
684
- /// sequence of characters delimited by spaces, tabs, or line terminators.
685
- /// Some common word delimiting punctuation isn't considered, so this
686
- /// property may not generally produce the desired results for multiword
687
- /// strings. See the `getLineStart(_:end:contentsEnd:for:)` method for
688
- /// additional information.
689
- ///
690
- /// Case transformations aren’t guaranteed to be symmetrical or to produce
691
- /// strings of the same lengths as the originals.
692
- public var capitalized : String {
693
- return _ns. capitalized as String
694
- }
695
-
696
- // @property (readonly, copy) NSString *localizedCapitalizedString NS_AVAILABLE(10_11, 9_0);
697
-
698
- /// A capitalized representation of the string that is produced
699
- /// using the current locale.
700
- @available ( macOS 10 . 11 , iOS 9 . 0 , * )
701
- public var localizedCapitalized : String {
702
- return _ns. localizedCapitalized
703
- }
704
-
705
- // - (NSString *)capitalizedStringWithLocale:(Locale *)locale
706
-
707
- /// Returns a capitalized representation of the string
708
- /// using the specified locale.
709
- public func capitalized( with locale: Locale ? ) -> String {
710
- return _ns. capitalized ( with: locale) as String
711
- }
712
-
713
672
// - (NSComparisonResult)caseInsensitiveCompare:(NSString *)aString
714
673
715
674
/// Returns the result of invoking `compare:options:` with
@@ -863,44 +822,6 @@ extension StringProtocol {
863
822
return _ns. components ( separatedBy: separator)
864
823
}
865
824
866
- // - (NSArray *)componentsSeparatedByString:(NSString *)separator
867
-
868
- /// Returns an array containing substrings from the string that have been
869
- /// divided by the given separator.
870
- ///
871
- /// The substrings in the resulting array appear in the same order as the
872
- /// original string. Adjacent occurrences of the separator string produce
873
- /// empty strings in the result. Similarly, if the string begins or ends
874
- /// with the separator, the first or last substring, respectively, is empty.
875
- /// The following example shows this behavior:
876
- ///
877
- /// let list1 = "Karin, Carrie, David"
878
- /// let items1 = list1.components(separatedBy: ", ")
879
- /// // ["Karin", "Carrie", "David"]
880
- ///
881
- /// // Beginning with the separator:
882
- /// let list2 = ", Norman, Stanley, Fletcher"
883
- /// let items2 = list2.components(separatedBy: ", ")
884
- /// // ["", "Norman", "Stanley", "Fletcher"
885
- ///
886
- /// If the list has no separators, the array contains only the original
887
- /// string itself.
888
- ///
889
- /// let name = "Karin"
890
- /// let list = name.components(separatedBy: ", ")
891
- /// // ["Karin"]
892
- ///
893
- /// - Parameter separator: The separator string.
894
- /// - Returns: An array containing substrings that have been divided from the
895
- /// string using `separator`.
896
- // FIXME(strings): now when String conforms to Collection, this can be
897
- // replaced by split(separator:maxSplits:omittingEmptySubsequences:)
898
- public func components<
899
- T : StringProtocol
900
- > ( separatedBy separator: T ) -> [ String ] {
901
- return _ns. components ( separatedBy: separator. _ephemeralString)
902
- }
903
-
904
825
// - (const char *)cStringUsingEncoding:(NSStringEncoding)encoding
905
826
906
827
/// Returns a representation of the string as a C string
@@ -1022,24 +943,6 @@ extension StringProtocol {
1022
943
//===--- Omitted for consistency with API review results 5/20/2014 ------===//
1023
944
// @property long long longLongValue
1024
945
1025
- // @property (readonly, copy) NSString *localizedLowercase NS_AVAILABLE(10_11, 9_0);
1026
-
1027
- /// A lowercase version of the string that is produced using the current
1028
- /// locale.
1029
- @available ( macOS 10 . 11 , iOS 9 . 0 , * )
1030
- public var localizedLowercase : String {
1031
- return _ns. localizedLowercase
1032
- }
1033
-
1034
- // - (NSString *)lowercaseStringWithLocale:(Locale *)locale
1035
-
1036
- /// Returns a version of the string with all letters
1037
- /// converted to lowercase, taking into account the specified
1038
- /// locale.
1039
- public func lowercased( with locale: Locale ? ) -> String {
1040
- return _ns. lowercased ( with: locale)
1041
- }
1042
-
1043
946
// - (NSUInteger)maximumLengthOfBytesUsingEncoding:(NSStringEncoding)enc
1044
947
1045
948
/// Returns the maximum number of bytes needed to store the
@@ -1262,24 +1165,6 @@ extension StringProtocol {
1262
1165
return _ns. trimmingCharacters ( in: set)
1263
1166
}
1264
1167
1265
- // @property (readonly, copy) NSString *localizedUppercaseString NS_AVAILABLE(10_11, 9_0);
1266
-
1267
- /// An uppercase version of the string that is produced using the current
1268
- /// locale.
1269
- @available ( macOS 10 . 11 , iOS 9 . 0 , * )
1270
- public var localizedUppercase : String {
1271
- return _ns. localizedUppercase as String
1272
- }
1273
-
1274
- // - (NSString *)uppercaseStringWithLocale:(Locale *)locale
1275
-
1276
- /// Returns a version of the string with all letters
1277
- /// converted to uppercase, taking into account the specified
1278
- /// locale.
1279
- public func uppercased( with locale: Locale ? ) -> String {
1280
- return _ns. uppercased ( with: locale)
1281
- }
1282
-
1283
1168
//===--- Omitted due to redundancy with "utf8" property -----------------===//
1284
1169
// - (const char *)UTF8String
1285
1170
@@ -1569,17 +1454,6 @@ extension StringProtocol {
1569
1454
// @property BOOL absolutePath;
1570
1455
// - (BOOL)isEqualToString:(NSString *)aString
1571
1456
1572
- // - (NSRange)lineRangeForRange:(NSRange)aRange
1573
-
1574
- /// Returns the range of characters representing the line or lines
1575
- /// containing a given range.
1576
- public func lineRange<
1577
- R : RangeExpression
1578
- > ( for aRange: R ) -> Range < Index > where R. Bound == Index {
1579
- return _toRange ( _ns. lineRange (
1580
- for: _toRelativeNSRange ( aRange. relative ( to: self ) ) ) )
1581
- }
1582
-
1583
1457
#if !DEPLOYMENT_RUNTIME_SWIFT
1584
1458
// - (NSArray *)
1585
1459
// linguisticTagsInRange:(NSRange)range
@@ -1617,17 +1491,6 @@ extension StringProtocol {
1617
1491
1618
1492
return result as! [ String ]
1619
1493
}
1620
-
1621
- // - (NSRange)paragraphRangeForRange:(NSRange)aRange
1622
-
1623
- /// Returns the range of characters representing the
1624
- /// paragraph or paragraphs containing a given range.
1625
- public func paragraphRange<
1626
- R : RangeExpression
1627
- > ( for aRange: R ) -> Range < Index > where R. Bound == Index {
1628
- return _toRange (
1629
- _ns. paragraphRange ( for: _toRelativeNSRange ( aRange. relative ( to: self ) ) ) )
1630
- }
1631
1494
#endif
1632
1495
1633
1496
// - (NSRange)rangeOfCharacterFromSet:(NSCharacterSet *)aSet
0 commit comments