Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.38 KB | None | 0 0
  1. ... "AND stay_exercise (? не очень понятная переменная) IN " + excercise.toSqlQuery() + " other stuff "...
  2.  
  3. fun List<String>.toSqlQuery(): String {
  4.     if(this.isEmpty()) return ""
  5.     val query = StringBuilder
  6.     forEachIndexed { i, ex ->
  7.         query.append(ex)
  8.         if (i + 1 != this.length()) query.append(",")
  9.     }
  10.     query.append(")")
  11.     return query.toString()
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement