Last active
August 29, 2015 14:18
-
-
Save kuwalab/1298b3d02b5e803a4106 to your computer and use it in GitHub Desktop.
Kotlin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tips.t001 | |
import java.io.BufferedWriter | |
import java.io.IOException | |
import java.nio.charset.StandardCharsets | |
import java.nio.file.Files | |
import java.nio.file.Paths | |
fun main(args: Array<String>) { | |
var outputPath = Paths.get("outputText.txt") | |
try { | |
Files.newBufferedWriter(outputPath, StandardCharsets.UTF_8).use<BufferedWriter, Unit> { | |
it.append("あいうえお") | |
it.newLine() | |
} | |
} catch (e: IOException) { | |
e.printStackTrace() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment