We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a64fc3b + 7e58b81 commit 61629eaCopy full SHA for 61629ea
stdlib/public/core/StringCharacterView.swift
@@ -34,6 +34,11 @@ extension String: BidirectionalCollection {
34
public var endIndex: Index { return _guts.endIndex }
35
36
/// The number of characters in a string.
37
+ ///
38
+ /// To check whether a string is empty,
39
+ /// use its `isEmpty` property instead of comparing `count` to zero.
40
41
+ /// - Complexity: O(n), where n is the length of the string.
42
@inline(__always)
43
public var count: Int {
44
return distance(from: startIndex, to: endIndex)
0 commit comments