A Cross-Platform String and Regular Expression Library written in Swift.

Overview

Guitar 🎸

A Cross-Platform String and Regular Expression Library written in Swift.

Build Status Platform

Swift Support CocoaPods SwiftPM Compatible

About

This library seeks to add common string manipulation functions, including common regular expression capabilities, that are needed in both mobile and server-side development, but are missing in Swift's Standard Library.

The full documentation can be found at http://www.sabintsev.com/Guitar/.

Guitar is also part of Swift's Source Compatibility Suite.

Features

  • Boolean Functions (isAlpha, isNumeric, isUppercase, etc.)
  • Case Functions (camelCased, pascalCased, kebabCased, etc.)
  • Latinization Functions (.latinized(), .withoutAccents())
  • Padding Functions (padLeft, padRight, pad)
  • Regular Expressions (with Common Patterns Built-in)

Sherlocked

A small set of functions offered by Guitar were removed in v0.3.0 of the library as Apple added many of these features to the Swift 4 language (aka, Sherlocking). The functions that were removed were: first, last, length, prefixed, suffixed, trimLeft, trimRight, truncated. The reversed function was renamed to reversedString as it acts slightly differently than Swift's built-in reversed function.

Installation Instructions

Swift Version Branch Name Will Continue to Receive Updates?
5.1+ master Yes
5.0 swift5.0 No
4.2 swift4.2 No
4.1 swift4.1 No
3.2 swift3.2 No
3.1 swift3.1 No

CocoaPods

pod 'Guitar' # Swift 5.1+
pod 'Guitar', :git => 'https://github.com/ArtSabintsev/Guitar.git', :branch => 'swift5.0' # Swift 5.0
pod 'Guitar', :git => 'https://github.com/ArtSabintsev/Guitar.git', :branch => 'swift4.2' # Swift 4.2
pod 'Guitar', :git => 'https://github.com/ArtSabintsev/Guitar.git', :branch => 'swift4.1' # Swift 4.1
pod 'Guitar', :git => 'https://github.com/ArtSabintsev/Guitar.git', :branch => 'swift3.2' # Swift 3.2
pod 'Guitar', :git => 'https://github.com/ArtSabintsev/Guitar.git', :branch => 'swift3.1' # Swift 3.1

Swift Package Manager

.Package(url: "https://github.com/ArtSabintsev/Guitar.git", majorVersion: 1)

Usage Examples

Regular Expression

  • Guitar makes it easier to use Regular Expressions to test and evaluate String objects.
  • Guitar.Chord enumerates common regular expressions and they are located in GuitarChord.swift.
  • GuitarCommon.swift contains a list of convenience methods for common regular expression evaluations and tests, such as checking the string to determine if it's a valid email address.

Initialization

Guitar(pattern: String) // A custom regular expression with which to initialize Guitar.

Guitar(chord: Guitar.Chord) // A common regular expression with which to initialize Guitar.

Methods

evaluateForRanges(::) returns an array of ranges, [Range<String.Index>], that match a specific regular expression.

Guitar(chord: .firstCharacter).evaluateForRanges(from: "Hello world") // [Range(Swift.String.CharacterView.Index(_base: Swift.String.UnicodeScalarView.Index(_position: 0), _countUTF16: 1)..<Swift.String.CharacterView.Index(_base: Swift.String.UnicodeScalarView.Index(_position: 1), _countUTF16: 1)), Range(Swift.String.CharacterView.Index(_base: Swift.String.UnicodeScalarView.Index(_position: 6), _countUTF16: 1)..<Swift.String.CharacterView.Index(_base: Swift.String.UnicodeScalarView.Index(_position: 7), _countUTF16: 1))]

evaluateForStrings(::) returns an array of strings, [String], that match a specific regular expression.

Guitar(chord: .firstCharacter).evaluateForStrings(from: "Hello world") // ["H", "w"]

test(::) evaluates a string with a specific regular expression. true is returned if matches are found in the string. Otherwise, false is returned.

Guitar(chord: .email).test(string: "[email protected]") // `true`

String Extension

This library also adds dozens of methods via String extensions that are missing in the Swift Standard Library or not easily accessible on the String class. Check GuitarBoolean.swift and GuitarPadding.swift to see these examples.

More specific examples can be found in the tests folder.

Inspiration

Created and maintained by

Arthur Ariel Sabintsev

Comments
  • Updated test coverage on Linux

    Updated test coverage on Linux

    • Capitalized the name of the imported module such that it can be compiled now.
    • Removed the TrimmingTests line because that suite doesn't exist anymore.
    • Reordered the lines to match the order of the files in the GuitarTests folder.
    opened by felix91gr 10
  • From snake case to slug case

    From snake case to slug case

    Hi, nice library 👍

    Just a question, how can I transform from case A to case B, like snake case to slug case hello_world -> hello-world? or from camel case to snake case, like helloWorld -> hello-world?

    opened by onmyway133 7
  • API inconsistency

    API inconsistency

    Hi, pretty nice lib you've got there - great work!

    I would just suggest a change in outputs of two methods that seem to be colliding in consistency:

    let string = "hello world"
    string.isLowercased() // False
    
    let string = "HELLO WORLD"
    string.isUpppercased() // True
    

    It's quite hard to program around such cases where the statement holds for one type (uppercase), but not for the other (lowercase). Especially when you'd expect true from both. I know there are language constraints, but the API is then quite inconsistent.

    Cheers!

    opened by svachmic 4
  • fix for characters not supported by utf8, such as some emoji

    fix for characters not supported by utf8, such as some emoji

    In swift, the count function of string uses utf8 by default. In this case, when you encounter some utf16 characters, the result returned by count function is problematic, but there is no such problem in OC, NSString length() default is utf16.

    opened by cjsliuj 2
  • Deprecation warnings for string.character in Swift 4

    Deprecation warnings for string.character in Swift 4

    Hi, I am using Guitar with Swift 4 and getting the following deprecation warnings due to the character view of strings now being deprecated (strings in Swift 4 are collection types again).

    This should be easy to solve, would you accept a PR for this?

    screenshot 2018-01-01 19 41 01
    opened by frankdilo 1
  • Suggested function name changes

    Suggested function name changes

    Something that has been prefixed or suffixed has had a prefix or suffix added to it. So I think those are bad names for trimming functions.

    How about these four prototypes instead:

      func trimRight( keeping length: Int ) -> String
      func trimRight( removing length: Int ) -> String
      func trimLeft( keeping length: Int ) -> String
      func trimLeft( removing length: Int ) -> String
    
    opened by CharlesJenkins 1
  • Guitar Integration with Multiple Targets

    Guitar Integration with Multiple Targets

    GuitarExample now contains four targeted platforms, with Guitar being installed into each target via a Podfile:

    • GuitarWatch-iOS
    • GuitarWatch-Mac
    • GuitarWatch-TV
    • GuitarWatch-Watch

    Changed minimum deployment targets to all Apple Platforms:

    • iOS 9+
    • macOS 10.11+
    • tvOS 9+
    • watchOS 3+
    opened by ArtSabintsev 1
  • Bump addressable from 2.7.0 to 2.8.0

    Bump addressable from 2.7.0 to 2.8.0

    Bumps addressable from 2.7.0 to 2.8.0.

    Changelog

    Sourced from addressable's changelog.

    Addressable 2.8.0

    • fixes ReDoS vulnerability in Addressable::Template#match
    • no longer replaces + with spaces in queries for non-http(s) schemes
    • fixed encoding ipv6 literals
    • the :compacted flag for normalized_query now dedupes parameters
    • fix broken escape_component alias
    • dropping support for Ruby 2.0 and 2.1
    • adding Ruby 3.0 compatibility for development tasks
    • drop support for rack-mount and remove Addressable::Template#generate
    • performance improvements
    • switch CI/CD to GitHub Actions
    Commits
    • 6469a23 Updating gemspec again
    • 2433638 Merge branch 'main' of github.com:sporkmonger/addressable into main
    • e9c76b8 Merge pull request #378 from ashmaroli/flat-map
    • 56c5cf7 Update the gemspec
    • c1fed1c Require a non-vulnerable rake
    • 0d8a312 Adding note about ReDoS vulnerability
    • 89c7613 Merge branch 'template-regexp' into main
    • cf8884f Note about alias fix
    • bb03f71 Merge pull request #371 from charleystran/add_missing_encode_component_doc_entry
    • 6d1d809 Adding note about :compacted normalization
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Swift 4 and Xcode 9 Support

    Swift 4 and Xcode 9 Support

    This is the Swift 4 version of Guitar.

    This PR will be open until Xcode 9 is released. I will update Guitar with each beta release of Xcode.

    CocoaPods

    pod 'Siren', :git => 'https://github.com/ArtSabintsev/Guitar', :branch => 'swift4'
    

    Carthage

    github "ArtSabintsev/Guitar", "swift4"
    
    opened by ArtSabintsev 0
  • Kebab Cased and Slug Cased

    Kebab Cased and Slug Cased

    Renamed slug-cased to kebab-cased.

    Removed kebab-cased's old implementation as it was an esoteric one.

    The appropriate implementation is that of the old slug-cased one.

    opened by ArtSabintsev 0
  • New Function: splitWordsByCase()

    New Function: splitWordsByCase()

    Added new splitWordsByCase() function that is able to create a string with whitespace-delimited words from any other case; camelCased, -kebab-cased-, PascalCase, snake_case, slug-case.

    Added lots more tests to test this new functionality.

    opened by ArtSabintsev 0
  • Bump tzinfo from 1.2.8 to 1.2.10

    Bump tzinfo from 1.2.8 to 1.2.10

    Bumps tzinfo from 1.2.8 to 1.2.10.

    Release notes

    Sourced from tzinfo's releases.

    v1.2.10

    TZInfo v1.2.10 on RubyGems.org

    v1.2.9

    • Fixed an incorrect InvalidTimezoneIdentifier exception raised when loading a zoneinfo file that includes rules specifying an additional transition to the final defined offset (for example, Africa/Casablanca in version 2018e of the Time Zone Database). #123.

    TZInfo v1.2.9 on RubyGems.org

    Changelog

    Sourced from tzinfo's changelog.

    Version 1.2.10 - 19-Jul-2022

    Version 1.2.9 - 16-Dec-2020

    • Fixed an incorrect InvalidTimezoneIdentifier exception raised when loading a zoneinfo file that includes rules specifying an additional transition to the final defined offset (for example, Africa/Casablanca in version 2018e of the Time Zone Database). #123.
    Commits
    • 0814dcd Fix the release date.
    • fd05e2a Preparing v1.2.10.
    • b98c32e Merge branch 'fix-directory-traversal-1.2' into 1.2
    • ac3ee68 Remove unnecessary escaping of + within regex character classes.
    • 9d49bf9 Fix relative path loading tests.
    • 394c381 Remove private_constant for consistency and compatibility.
    • 5e9f990 Exclude Arch Linux's SECURITY file from the time zone index.
    • 17fc9e1 Workaround for 'Permission denied - NUL' errors with JRuby on Windows.
    • 6bd7a51 Update copyright years.
    • 9905ca9 Fix directory traversal in Timezone.get when using Ruby data source
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump cocoapods-downloader from 1.4.0 to 1.6.3

    Bump cocoapods-downloader from 1.4.0 to 1.6.3

    Bumps cocoapods-downloader from 1.4.0 to 1.6.3.

    Release notes

    Sourced from cocoapods-downloader's releases.

    1.6.3

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.2

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.1

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.0

    Enhancements
    • None.
    Bug Fixes
    • Adds a check for command injections in the input for hg and git.
      orta #124

    1.5.1

    Enhancements
    • None.
    Bug Fixes
    • Fix "can't modify frozen string" errors when pods are integrated using the branch option
      buju77 #10920

    1.5.0

    ... (truncated)

    Changelog

    Sourced from cocoapods-downloader's changelog.

    1.6.3 (2022-04-01)

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.2 (2022-03-28)

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.1 (2022-03-23)

    Enhancements
    • None.
    Bug Fixes
    • None.

    1.6.0 (2022-03-22)

    Enhancements
    • None.
    Bug Fixes
    • Adds a check for command injections in the input for hg and git.
      orta #124

    1.5.1 (2021-09-07)

    Enhancements
    • None.

    ... (truncated)

    Commits
    • c03e2ed Release 1.6.3
    • f75bccc Disable Bazaar tests due to macOS 12.3 not including python2
    • 52a0d54 Merge pull request #128 from CocoaPods/validate_before_dl
    • d27c983 Ensure that the git pre-processor doesn't accidentally bail also
    • 3adfe1f [CHANGELOG] Add empty Master section
    • 591167a Release 1.6.2
    • d2564c3 Merge pull request #127 from CocoaPods/validate_before_dl
    • 99fec61 Switches where we check for invalid input, to move it inside the download fun...
    • 96679f2 [CHANGELOG] Add empty Master section
    • 3a7c54b Release 1.6.1
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(1.2.0)
  • 1.2.0(Nov 22, 2020)

    #27: Thanks to @gezihuzi for noticing an issue with evaluateForRanges in Guitar.swift. The method now properly passes custom defined options.

    Source code(tar.gz)
    Source code(zip)
  • 1.1.3(Nov 22, 2020)

  • 1.1.2(Jun 15, 2020)

  • 1.1.1(Jun 13, 2020)

  • 1.1.0(Sep 15, 2019)

  • 1.0.2(Aug 13, 2019)

    I fixed the Package.swift so that it is now compatible with Xcode 11 and the latest Swift Package Manifest file (// swift-tools-version:4.0).

    Source code(tar.gz)
    Source code(zip)
  • 1.0.1(Apr 6, 2019)

  • 1.0.0(Mar 31, 2019)

    This library has worked as-is for 2 years. Therefore, I am promoting this library to v1.0.0! 🍾

    • Updated for Swift 5
    • Drops iOS-9/tvOS-9 Support
    • #23: evaluateForRanges now supports UTF-16 encoded strings by default (thanks to @cjsliuj)
    Source code(tar.gz)
    Source code(zip)
  • 0.5.0(Sep 17, 2018)

    As of Guitar v0.5.0, , all future changes on master will be done in Xcode 10 using Swift 4.2.

    For those using Swift v4.1.0, please check out the swift4.1 branch or version 0.4.1 - both point to the same commit hash.

    Source code(tar.gz)
    Source code(zip)
  • 0.4.1(May 3, 2018)

  • 0.4.0(Mar 29, 2018)

  • 0.3.1(Mar 15, 2018)

  • 0.3.0(Sep 14, 2017)

    Siren v0.3.0 adds support for Swift 4 / iOS 11 / Xcode 9.

    A small set of functions offered by Guitar were removed in this version as Apple added many of these features to the Swift 4 language. The functions that were removed were: first, last, length, prefixed, suffixed, trimLeft, trimRight, truncated. The reversed function was renamed to reversedString as it acts slightly differently than Swift's built-in reversed function.

    Moving forward, only support for the Swift 4 codebase (on master) will be maintained.

    | Swift Version | Branch Name | Will Continue to Receive Updates? | ------------- | ------------- | ------------- | 4.0 | master | Yes | 3.2 | swift3.2 | No | 3.1 | swift3.1 | No

    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Apr 25, 2017)

    #18

    • Tests moved to Tests/ folder in root directory
    • Added support for Linux Tests.
    • Invoked #availability and #if os() checks where necessary.
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Apr 15, 2017)

    As of v0.1.0, Guitar has transitioned from alpha to beta.

    The existing API has stabilized and tests have been written for each public method and extension. Documentation has also been updated. To move from beta to a 1.0.0 release, more real-world testing is needed.

    Please leave issues and PRs with any missing features or bugs!

    Thanks!

    Arthur

    Source code(tar.gz)
    Source code(zip)
  • 0.0.15(Apr 9, 2017)

    #16 Adds a latinization function (thanks to @EthanSchatzline)

        func testLatinized() {
            XCTAssertEqual("Hello! こんにちは! สวัสดี! مرحبا! 您好!".latinized(), "Hello! kon'nichiha! swasdi! mrhba! nin hao!")
            XCTAssertEqual("как прекрасен этот мир".latinized(), "kak prekrasen etot mir")
            XCTAssertEqual("你叫(做)乜野名呀?".latinized(), "ni jiao (zuo) mie ye ming ya?")
            XCTAssertEqual("어떻게 지내세요?".latinized(), "eotteohge jinaeseyo?")
            XCTAssertEqual("What a wonderful world! That's not cliché at all!".latinized(), "What a wonderful world! That's not cliche at all!")
    
        }
    
    Source code(tar.gz)
    Source code(zip)
  • 0.0.14(Apr 8, 2017)

    #15

    • @EthanSchatzline added the implementation and tests for withoutAccents(), which removes diacritics (e.g., accent marks) from latin characters. This is sometime referred to as latinization.
    Source code(tar.gz)
    Source code(zip)
  • 0.0.13(Mar 27, 2017)

  • 0.0.12(Mar 27, 2017)

  • 0.0.11(Mar 13, 2017)

    In #12, I added a new splitWordsByCase() function that is able to create a string with whitespace-delimited words from any other case; camelCased, -kebab-cased-, PascalCase, snake_case, slug-case.

    A few examples from the tests:

        func testCaseMorphing() {
            let string = "Hello World"
    
            XCTAssertEqual(string.camelCased().kebabCased(), "-hello-world-")
            XCTAssertEqual(string.camelCased().pascalCased(), "HelloWorld")
            XCTAssertEqual(string.camelCased().slugCased(), "hello-world")
            XCTAssertEqual(string.camelCased().snakeCased(), "hello_world")
    
            XCTAssertEqual(string.kebabCased().camelCased(), "helloWorld")
            XCTAssertEqual(string.kebabCased().pascalCased(), "HelloWorld")
            XCTAssertEqual(string.kebabCased().slugCased(), "hello-world")
            XCTAssertEqual(string.kebabCased().snakeCased(), "hello_world")
    
            XCTAssertEqual(string.pascalCased().camelCased(), "helloWorld")
            XCTAssertEqual(string.pascalCased().kebabCased(), "-hello-world-")
            XCTAssertEqual(string.pascalCased().slugCased(), "hello-world")
            XCTAssertEqual(string.pascalCased().snakeCased(), "hello_world")
    
            XCTAssertEqual(string.slugCased().camelCased(), "helloWorld")
            XCTAssertEqual(string.slugCased().kebabCased(), "-hello-world-")
            XCTAssertEqual(string.slugCased().pascalCased(), "HelloWorld")
            XCTAssertEqual(string.slugCased().snakeCased(), "hello_world")
    
            XCTAssertEqual(string.snakeCased().camelCased(), "helloWorld")
            XCTAssertEqual(string.snakeCased().kebabCased(), "-hello-world-")
            XCTAssertEqual(string.snakeCased().pascalCased(), "HelloWorld")
            XCTAssertEqual(string.snakeCased().slugCased(), "hello-world")
        }
    
    Source code(tar.gz)
    Source code(zip)
  • 0.0.10(Mar 11, 2017)

    • Implemented Capitalized()
    • Fixed Decapitalized()
    • Enhanced slugCased(), kebabCased(), snakeCased() to allow for case-conversion from one to the other.
    • Fixed a lot of improper inline documentation.
    • Added a lot more tests
    • Split GuitarNSRangeExtension class from Guitar struct
    • Split GuitarChord struct from Guitar struct
    • Added more Chords to GuitarChord
    • Updated README
    • Updated Docs
    Source code(tar.gz)
    Source code(zip)
  • 0.0.9(Mar 10, 2017)

    • GuitarRegex has been renamed to Guitar.
    • Guitar(pattern:) initializer has been renamed to Guitar(chord:)
    • GuitarPattern is now accessed via Guitar.Chord
    • Removed prefix operator -
    • Added new sanitization function on Guitar
    • Fixed pascalCased().
    • Fixed some documentation.

    See build details and artifacts at buddybuild: https://dashboard.buddybuild.com/apps/58b67d22d21c470100b0c394/build/58c23b0980c8d40100babafa

    Source code(tar.gz)
    Source code(zip)
  • 0.0.8(Mar 9, 2017)

    • Separated String extensions into 5 separate files.
    • Added Regular Expression syntactic-sugar layer on top of NSRegularExpression.
    • Added stub for new capitalized() function that will augment Swift's capitalized computer variable.
    • Added more tests

    API is still highly unstable, but things are progressing in the right direction.

    See build details and artifacts at buddybuild: https://dashboard.buddybuild.com/apps/58b67d22d21c470100b0c394/build/58c18c4ea2fb9101008e402f

    Source code(tar.gz)
    Source code(zip)
  • 0.0.6(Mar 10, 2017)

    In the process of Fixing Swift PM support, I broke Carthage support. All dependency managers should now be able to reach and resolve Guitar properly.

    Source code(tar.gz)
    Source code(zip)
  • 0.0.5(Mar 4, 2017)

  • 0.0.4(Mar 2, 2017)

    • All public functions now have full Unit Test coverage except for decapitalized(), which has a broken implementation.
    • Renamed truncate() to truncated() and fixed implementation.
    • Added tests for all Trimming functions.

    See build details and artifacts at buddybuild: https://dashboard.buddybuild.com/apps/58b67d22d21c470100b0c394/build/58b7caec95315a010041d9d3

    Source code(tar.gz)
    Source code(zip)
  • 0.0.3(Mar 2, 2017)

    • Added Unit Tests for Boolean, Case, Character, and Padding functions.
    • Added length function.
    • Fixed multiple functions (thanks to Unit Tests).

    See build details and artifacts at buddybuild: https://dashboard.buddybuild.com/apps/58b67d22d21c470100b0c394/build/58b7c4722cb92b010066bcab

    Source code(tar.gz)
    Source code(zip)
  • 0.0.2(Mar 1, 2017)

    This project is currently _NOT PRODUCTION_ ready.

    This release adds the following methods

    • reverse()
    • pad()
    • truncate()

    Also adds more inline documentation, Jazzy Docs, SwiftLint conformance, and more.

    See build details and artifacts at buddybuild: https://dashboard.buddybuild.com/apps/58b67d22d21c470100b0c394/build/58b6e0894f23990100b72d7f

    Source code(tar.gz)
    Source code(zip)
  • 0.0.1(Feb 28, 2017)

    This project is currently _NOT PRODUCTION_ ready. The release was made to add support for Carthage and CocoaPods.

    The following functions have been implemented, but not tested:

    • Boolean Operations
      • isAlpha()
      • isAlphanumeric()
      • isCapitalized()
      • isDecapitalized()
      • isLowercased()
      • isNumeric()
      • isUppercased()
    • Case Operations
      • camelCased()
      • decapitalized()
      • kebabCased()
      • pascalCased()
      • slug()
      • snakeCased()
      • swapCased()
    • Character Operations
      • first()
      • last()
    • Padding Operations
      • padLeft()
      • padRight()
    • Trimming Operations
      • prefixed()
      • suffixed()
      • trimLeft()
      • trimRight()
    Source code(tar.gz)
    Source code(zip)
Owner
Arthur Ariel Sabintsev
Senior Engineering Manager
Arthur Ariel Sabintsev
Swift String Validator. Simple lib for ios to validate string and UITextFields text for some criterias

Swift String validator About Library for easy and fastest string validation based on сciterias. Instalation KKStringValidator is available through Coc

Kostya 17 Dec 21, 2019
SwiftVerbalExpressions is a Swift library that helps to construct difficult regular expressions

SwiftVerbalExpressions Swift Regular Expressions made easy SwiftVerbalExpressions is a Swift library that helps to construct difficult regular express

null 582 Jun 29, 2022
Regular expressions for swift

Regex Advanced regular expressions for Swift Goals Regex library was mainly introduced to fulfill the needs of Swift Express - web application server

Crossroad Labs 328 Nov 20, 2022
BonMot is a Swift attributed string library

BonMot (pronounced Bon Mo, French for good word) is a Swift attributed string library. It abstracts away the complexities of the iOS, macOS, tvOS, and

Rightpoint 3.4k Dec 30, 2022
Croc is a swift emoji string parsing library

Croc is a library for parsing emojis on iOS. It provides a simple and lightweight interface for detecting, generating, categorizing and managing emoji characters, making emoji-powered features an easy task for developers.

Joe Kalash 127 Nov 20, 2022
Swift emoji string parsing library

Croc is a library for parsing emojis on iOS. It provides a simple and lightweight interface for detecting, generating, categorizing and managing emoji

Joe Kalash 125 Sep 27, 2021
🌍⏩📄 Convert ISO8859 1-16 Encoded Text to String in Swift. Supports iOS, tvOS, watchOS and macOS.

ISO8859 Convert ISO8859 1-16 Encoded Text to String in Swift. Usage let encoding = ISO8859.part1 let string = String([...], iso8859Encoding: encoding)

Devran Cosmo Uenal 18 Jan 2, 2023
More powerful label, attributed string builder and text parser.

DDText More powerful label, attributed string builder and text parser. DDLabel More powerful label than UILabel, using TextKit. It supports features b

Daniel 16 Nov 8, 2022
String (and more) validation for iOS

Swift Validators ?? String validation for iOS. Contents Installation Walkthrough Usage Available validators License ReactiveSwift + SwiftValidators Wa

George Kaimakas 241 Nov 13, 2022
Great Swift String Pluralize Extension

Pluralize.swift Great Swift String Pluralize Extension case-insensitive tons of rules for irregular nouns (plural form) supports uncountable nouns all

Joshua Arvin Lat 193 Nov 8, 2022
👩‍🎨 Elegant Attributed String composition in Swift sauce

Elegant Attributed String composition in Swift sauce SwiftRichString is a lightweight library which allows to create and manipulate attributed strings

Daniele Margutti 2.9k Jan 5, 2023
A comprehensive, lightweight string extension for Swift

SwiftString SwiftString is a lightweight string extension for Swift. This library was motivated by having to search StackOverflow for common string op

Andrew Mayne 1.6k Dec 30, 2022
Easy string decoration with styles

StyleDecorator Design string simply by linking attributes. Example Create Decorator with specific Style and link it at the end of needed string or wra

Dmytro Pylypenko 15 Nov 4, 2021
Easy Attributed String Creator

The main idea of this project is to have an online tool to be able to visually add formatting to a text and get back a swift and/or objective-c code t

Andres Canal 283 Dec 27, 2022
Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform.

twitter-text This repository is a collection of libraries and conformance tests to standardize parsing of Tweet text. It synchronizes development, tes

Twitter 2.9k Dec 27, 2022
AttributedText is a Swift µpackage that provides NSAttributedString rendering in SwiftUI by wrapping either an NSTextView or a UITextView depending on the platform.

AttributedText AttributedText is a Swift µpackage that provides NSAttributedString rendering in SwiftUI by wrapping either an NSTextView or a UITextVi

null 1 Jul 18, 2022
Lightweight library to set an Image as text background. Written in swift.

![](https://img.shields.io/badge/Swift 2-compatible-4BC51D.svg?style=flat-square) Simple and light weight UIView that animate text with an image. Demo

Lucas Ortis 552 Sep 9, 2022
An NSPredicate DSL for iOS, OSX, tvOS, & watchOS. Inspired by SnapKit and lovingly written in Swift.

PrediKit A Swift NSPredicate DSL for iOS & OS X inspired by SnapKit, lovingly written in Swift, and created by that weird dude at KrakenDev. If you're

Hector Matos 542 Sep 24, 2022