mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +00:00
Attempt to fix SQLite crash in migration.
This commit is contained in:
@@ -21,3 +21,20 @@ fun String.asListContains(item: String): Boolean {
|
||||
.map { it.substring(0, it.length - 1) }
|
||||
.any { item.startsWith(it) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns a multi-line string into a single-line string stripped of indentation, separated by spaces instead of newlines.
|
||||
*
|
||||
* e.g.
|
||||
*
|
||||
* a
|
||||
* b
|
||||
* c
|
||||
*
|
||||
* turns into
|
||||
*
|
||||
* a b c
|
||||
*/
|
||||
fun String.toSingleLine(): String {
|
||||
return this.trimIndent().split("\n").joinToString(separator = " ")
|
||||
}
|
||||
Reference in New Issue
Block a user