Skip to content

Commit

Permalink
publish NSString.locationUpToCharacter
Browse files Browse the repository at this point in the history
  • Loading branch information
DivineDominion committed Jan 22, 2025
1 parent 2db2105 commit d5a7022
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import Foundation

@usableFromInline
enum Direction {
public enum Direction {
/// Left-to-right or towards-the-end search in a string.
case downstream
/// Right-to-left or towards-the-beginning search in a string.
Expand All @@ -27,8 +26,8 @@ extension NSString {
///
/// "a ˇ(test) text" // Downstream / from left to right
/// "a (test)ˇ text" // Upstream / from right to left
@usableFromInline
func locationUpToCharacter(
@inlinable
public func locationUpToCharacter(
from characterSet: CharacterSet,
direction: Direction,
in range: NSRange
Expand Down Expand Up @@ -57,7 +56,7 @@ extension NSString {

extension CharacterSet {
@inlinable
func contains(characterSequence: NSString) -> Bool {
func contains(characterSequence: NSString) -> Bool {
return characterSequence.rangeOfCharacter(from: self) == NSRange(location: 0, length: characterSequence.length)
}
}

0 comments on commit d5a7022

Please sign in to comment.