Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yockow/swiftstringcomposition
`SwiftStringComposition` provides some features that handles `String` as a collection of lines.
https://github.com/yockow/swiftstringcomposition
Last synced: 24 days ago
JSON representation
`SwiftStringComposition` provides some features that handles `String` as a collection of lines.
- Host: GitHub
- URL: https://github.com/yockow/swiftstringcomposition
- Owner: YOCKOW
- License: mit
- Created: 2020-02-14T04:03:40.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-25T11:10:52.000Z (about 2 years ago)
- Last Synced: 2023-03-02T05:27:01.557Z (over 1 year ago)
- Language: Swift
- Size: 46.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# SwiftStringComposition
`SwiftStringComposition` provides some features that handles `String` as a collection of lines.
# Requirements
- Swift 5.1
- macOS(>=10.15) or Linux## Dependencies
![Dependencies](./dependencies.svg)
# Usage
```Swift
import StringCompositionlet string = """
#includeint 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)
/*
#includeint main(int argc, char* argv[]) {
printf("Hello, world!");
return 0;
}
*/```
# License
MIT License.
See "LICENSE.txt" for more information.