Skip to content

Instantly share code, notes, and snippets.

@sajjadyousefnia
Created July 18, 2018 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajjadyousefnia/115c5228b3433904d2d23e7ed01a7567 to your computer and use it in GitHub Desktop.
Save sajjadyousefnia/115c5228b3433904d2d23e7ed01a7567 to your computer and use it in GitHub Desktop.
// روش معمول
fun makeDir(path: String): File {
val result = File(path)
result.mkdirs()
return result
}
// روش بهبودیافته
fun makeDir(path: String) = path.let{ File(it) }.also{ it.mkdirs() }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment