{"id":19222703,"url":"https://github.com/novichenkoanton/stringify","last_synced_at":"2025-08-20T01:13:07.673Z","repository":{"id":38293602,"uuid":"248149353","full_name":"NovichenkoAnton/Stringify","owner":"NovichenkoAnton","description":"A set of usefull string extensions","archived":false,"fork":false,"pushed_at":"2024-08-01T23:23:17.000Z","size":169,"stargazers_count":6,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-20T04:07:51.600Z","etag":null,"topics":["cocoapods","nsmutableattributedstring","numberformatter","string","stringify","swift","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NovichenkoAnton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-03-18T05:49:52.000Z","updated_at":"2024-01-20T21:13:00.000Z","dependencies_parsed_at":"2025-05-13T10:41:46.749Z","dependency_job_id":"b4b4d39d-75de-43ee-bc8e-99e02c589c8a","html_url":"https://github.com/NovichenkoAnton/Stringify","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/NovichenkoAnton/Stringify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NovichenkoAnton%2FStringify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NovichenkoAnton%2FStringify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NovichenkoAnton%2FStringify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NovichenkoAnton%2FStringify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NovichenkoAnton","download_url":"https://codeload.github.com/NovichenkoAnton/Stringify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NovichenkoAnton%2FStringify/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267278631,"owners_count":24063252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocoapods","nsmutableattributedstring","numberformatter","string","stringify","swift","xcode"],"created_at":"2024-11-09T15:05:15.117Z","updated_at":"2025-07-27T01:04:59.845Z","avatar_url":"https://github.com/NovichenkoAnton.png","language":"Swift","readme":"# The project moved to: https://github.com/NovichenkoAnton/Extendy\n\n# Stringify\nA set of useful string extensions.\n\n[![Version](https://img.shields.io/cocoapods/v/Stringify)](https://cocoapods.org/pods/Stringify)\n[![License](https://img.shields.io/cocoapods/l/Stringify)](https://raw.githubusercontent.com/NovichenkoAnton/Stringify/master/LICENSE)\n[![Platform](https://img.shields.io/cocoapods/p/Stringify)](https://cocoapods.org/pods/Stringify)\n\n## Requirements\n\n- iOS 10.0+\n- Swift 5+\n\n## Installation\n\n### CocoaPods\n\nStringify is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your Podfile:\n\n```ruby\npod 'Stringify', '~\u003e 1.0'\n```\n\n### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.\n\nOnce you have your Swift package set up, adding Stringify as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/NovichenkoAnton/Stringify.git\", .upToNextMajor(from: \"1.0.0\"))\n]\n```\n\n## Usage\n\n### String\n1. Apply masks for the string in specific range. The range compatible with `CountableRange`, `ClosedRange`, `PartialRangeFrom`, `PartialRangeThrough`, `PartialRangeUpTo`.\n\n```swift\nlet cardNumber = \"1234567890123456\"\nlet masked = cardNumber.maskSubstring(in: 6...13, with: \"*\")\nprint(masked!) //\"123456********56\"\n```\n\n2. Convert `String` to `Double`. If `String` is not compatible with `Double` the function will return 0.00.\n\n``` swift\nlet amount = \"100,12\"\nprint(amount.toDouble()) //100.12\n\nlet anotherAmount = \"1 200,10\"\nprint(anotherAmount.toDouble()) //1200.1 \n``` \n\n3. You can apply specific format for strings\n```swift\nlet sum = \"1234\"\nlet formattedSum = sum.st.applyFormat(.sum)\nprint(formattedSum) //\"1 234,00\"\n```\n\nSupported formats\n```swift\nenum Format {\n  case sum(minFractionDigits: Int = 2, maxFractionDigits: Int = 2)\n  case creditCard\n  case iban\n  case custom(formatter: NumberFormatter)\n}\n```\n\n4. Validate a number of credit card by Luhn algorithm.\n\n5. Validate the string with specific pattern\n\n```swift\n\"https://www.google.com\".validate(with: .website) //true\n```\n\n6. Simple date formatter (from one format to another)\n\n```swift\nlet dateTime = \"2019-11-22 13:33\"\n\nlet resultTime = dateTime.st.convertDate(from: \"yyyy-MM-dd HH:mm\", to: \"h:mm\") //\"1:33\"\n```\n\n7. Get query items from `String` that corresponds to `URL` type. Works for URLs with cyrillic domain names.\n\n```swift\nlet stringURL = \"https://test.com?foo=1\u0026bar=abc\"\n\nlet queryItems = stringURL.queryItems()! //[\"foo\": \"1\", \"bar\": \"abc\"]\n```\n\n### NSMutableAttributedString\n1. You can append two attributed strings with `+`\n\n```swift\nlet part1 = \"123\"\nlet part2 = \"456\"\n\nmyLabel.attributedText = part1.attributed + part2.attributed\n```\n\n2. Apply attributes for mutable string\n\n```swift\nlet string = \"Some text\"\n\nlabel.attributedText = string.attributed.applyAttributes([\n  .color(color: .red),\n  .font(font: .systemFont(ofSize: 32, weight: .bold)),\n  .crossed(width: 1, color: .black),\n  .underline(style: .single, color: .blue)\n])\n```\n\n![screenshot1](https://user-images.githubusercontent.com/8337067/77320216-38a66a00-6d21-11ea-8d1c-1ca8bf0bb9a7.png)\n\n3. Apply styles for string\n\n```swift\nlet sum = \"1000,22\"\n\nlabel.attributedText = sum.attributed.applyStyle(.sum(integerAttrs: [\n  .color(color: UIColor.red),\n  .font(font: UIFont.systemFont(ofSize: 32, weight: .bold)),\n  .underline(style: .double, color: .black)\n], fractionAttrs: [\n  .color(color: UIColor.green),\n  .font(font: UIFont.systemFont(ofSize: 24, weight: .medium)),\n], currencyMark: \"$\"))\n```\n\n![screenshot2](https://user-images.githubusercontent.com/8337067/77320368-7dca9c00-6d21-11ea-81fe-3e9162955fa2.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovichenkoanton%2Fstringify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnovichenkoanton%2Fstringify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovichenkoanton%2Fstringify/lists"}