Swiftpack.co -  YOCKOW/SwiftStringComposition as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
YOCKOW/SwiftStringComposition
`SwiftStringComposition` provides some features that handles `String` as a collection of lines.
.package(url: "https://github.com/YOCKOW/SwiftStringComposition.git", from: "2.0.2")

SwiftStringComposition

SwiftStringComposition provides some features that handles String as a collection of lines.

Requirements

  • Swift 5.1
  • macOS(>=10.15) or Linux

Dependencies

Dependencies

Usage

import StringComposition


let string = """
#include <stdio.h>

int main(int argc, char* argv[]) {
printf("Hello, world!");
return 0;
}
"""

var lines = String.Composition(string)
lines.shiftRight(1, in: 3...4)
lines.indent = .spaces(count: 4)

print(lines.description)
/*
#include <stdio.h>

int main(int argc, char* argv[]) {
    printf("Hello, world!");
    return 0;
}
*/

License

MIT License.
See "LICENSE.txt" for more information.

GitHub

link
Stars: 0
Last commit: 4 days ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API