Files
libnovel/ios/LibNovelV2/Extensions/String+App.swift
Admin 7413313100
All checks were successful
CI / Scraper / Lint (push) Successful in 10s
CI / Scraper / Test (push) Successful in 14s
Release / Scraper / Test (push) Successful in 18s
CI / Scraper / Lint (pull_request) Successful in 18s
Release / UI / Build (push) Successful in 23s
CI / Scraper / Test (pull_request) Successful in 15s
CI / UI / Build (pull_request) Successful in 32s
Release / Scraper / Docker (push) Successful in 55s
CI / Scraper / Docker Push (pull_request) Has been skipped
CI / UI / Docker Push (pull_request) Has been skipped
CI / Scraper / Docker Push (push) Successful in 1m5s
Release / UI / Docker (push) Successful in 1m12s
iOS CI / Build (push) Successful in 4m18s
iOS CI / Build (pull_request) Successful in 4m25s
iOS CI / Test (push) Successful in 8m11s
iOS CI / Test (pull_request) Successful in 8m21s
fix: update integration_test.go to match server.New signature (version, commit args)
2026-03-14 14:25:46 +05:00

20 lines
619 B
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import Foundation
extension String {
/// Strips trailing date parentheticals from chapter titles.
/// Handles formats like:
/// " (January 5, 2025)"
/// " - Jan 01 2024"
func strippingTrailingDate() -> String {
let patterns = [
#"\s*\([A-Za-z]+ \d{1,2},\s+\d{4}\)\s*$"#,
#"\s*[-]\s*\w+\s+\d{1,2}\s+\d{4}\s*$"#,
]
var result = self
for pattern in patterns {
result = result.replacingOccurrences(of: pattern, with: "", options: .regularExpression)
}
return result.trimmingCharacters(in: .whitespaces)
}
}