mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
514 B
Swift
19 lines
514 B
Swift
|
|
public extension String {
|
|
|
|
func removingIdPrefixIfNeeded() -> String {
|
|
var result = self
|
|
if result.count == 66 && (try? SessionId.Prefix(from: result)) != nil { result.removeFirst(2) }
|
|
return result
|
|
}
|
|
}
|
|
|
|
@objc public extension NSString {
|
|
|
|
@objc func removingIdPrefixIfNeeded() -> NSString {
|
|
var result = self as String
|
|
if result.count == 66 && (try? SessionId.Prefix(from: result)) != nil { result.removeFirst(2) }
|
|
return result as NSString
|
|
}
|
|
}
|