PlugFox/multiline
提供方便的多行字串記錄存取方法擴展。
- Stars
- 6
- Forks
- 0
- 最近推送(UTC)
- 2022年8月18日
- 專案狀態
- 未封存
技術主題
使用的依賴
原始 README
以下為英文專案原文快照,最新內容請造訪 GitHub。
展開 / 收合專案 README
multiline
https://github.com/PlugFox/multiline/raw/master/.img/logo.png
Actions Status Coverage Pub Code size License: WTFPL effective_dart GitHub stars
About
Provides convenient access to multiline String records with method extensions.
Useful for templates, mockups and SQL queries.
Just use the symbol "|" to indicate the beginning of a line.
Beautiful code formatting using some useful extensions to the String methods.
Available method extensions:
-
multiline()- return formatted with pipeline symbol "|"String. -
multilineSplit()- splits the string and returns aIterable<String>of substrings.
You can use custom "pipeline" and "join" symbols.
For example
import 'package:multiline/multiline.dart'; // <= import package
void main() {
/// Return formatted with pipeline symbol "`|`" [String].
final string =
'''
|/*
| * List of books and the number of
| * authors associated with each book
| */
|SELECT
| `books`.`title` AS `Title`,
| count(*) AS `Authors`
|FROM `books`
|JOIN `authors`
| ON `books`.`isbn` = `authors`.`isbn`
|GROUP BY
| `books`.`title`
|ORDER BY
| `books`.`title` ASC
|;
'''.multiline();
print(string);
/// Splits the string and returns a [Iterable] of substrings.
final iterable =
'''
| * One
| * Two
| * Three
'''.multilineSplit();
iterable.forEach(print);
}
Coverage
https://codecov.io/gh/PlugFox/multiline/branch/master/graphs/sunburst.svg
Changelog
Refer to the Changelog to get all release notes.