Skip to content

Instantly share code, notes, and snippets.

@dgadiraju
Created November 23, 2017 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dgadiraju/36a4e4523a77a74421dbb86cfc871af9 to your computer and use it in GitHub Desktop.
Save dgadiraju/36a4e4523a77a74421dbb86cfc871af9 to your computer and use it in GitHub Desktop.
//String Manipulation
val str = orders.first
val a = str.split(",")
val orderId = a(0).toInt
a(1).contains("2013")
val orderDate = a(1)
orderDate.substring(0, 10)
orderDate.substring(5, 7)
orderDate.substring(11)
orderDate.replace('-', '/')
orderDate.replace("07", "July")
orderDate.indexOf("2")
orderDate.indexOf("2", 2)
orderDate.length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment