Skip to content

Commit 3fadb2a

Browse files
committed
Upadates method documentation
1 parent 2fdd8b8 commit 3fadb2a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Brute-Force String Search/BruteForceStringSearch.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
Brute-force string search
33
*/
44
extension String {
5+
/// Searches the string for the pattern provided, returning the index of ocurrency. This algorithm uses a brute force approach.
6+
/// - Parameter pattern: The stering patter to be searched.
7+
/// - Returns: where the pattern starts to occur.
58
func indexOf(_ pattern: String) -> String.Index? {
69
for i in self.characters.indices {
710
var j = i

0 commit comments

Comments
 (0)