Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// روش معمول
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