-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3733af
commit 183a5b5
Showing
9 changed files
with
175 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// Utils.swift | ||
// GenesisSwiftTests | ||
// | ||
// Created by Ivaylo Hadzhiev on 23.10.24. | ||
// Copyright © 2024 eMerchantPay. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
enum Utils { | ||
|
||
static func valueBetween(start: String, end: String, in text: String) -> String? { | ||
guard let startIndex = text.range(of: start, options: .caseInsensitive)?.upperBound else { return nil } | ||
guard let endIndex = text.range(of: end, options: .caseInsensitive)?.lowerBound else { return nil } | ||
guard startIndex < endIndex else { return nil } | ||
|
||
return String(text[startIndex..<endIndex]) | ||
} | ||
|
||
static func xmlValue(inTag tag: String, from xml: String) -> String? { | ||
let startTag = "<\(tag)>" | ||
let endTag = "</\(tag)>" | ||
return valueBetween(start: startTag, end: endTag, in: xml) | ||
} | ||
} |