Kotlin - How to write to file with Kotlin language » grokonez

Kotlin - How to write to file with Kotlin language » grokonez

This tutorial shows you how to write to File in Kotlin using PrintWriter, BufferedWriter or just File Kotlin extension functions. ContentsI. TechnologyII. Practice1. PrintWriter2. BufferedWriter3. File Kotlin extension functions4. When input text is null I. Technology – Java 1.8 – Kotlin 1.1.2 II. Practice 1. PrintWriter import java.io.File fun main(args: Array) { val outString: String … Continue reading "Kotlin – How to write to file with Kotlin language"

https://grokonez.com/kotlin/kotlin-write-file-kotlin-language

Kotlin – How to write to file with Kotlin language

This tutorial shows you how to write to File in Kotlin using PrintWriter, BufferedWriter or just File Kotlin extension functions.

I. Technology

- Java 1.8 - Kotlin 1.1.2

II. Practice

1. PrintWriter


import java.io.File

fun main(args: Array) {

val outString: String = "Kotlin\nBe Kotlineer - Be Simple - Be Connective."
File("kotlin1.txt").printWriter().use { out -> out.println(outString) }

}

Check Result:


Kotlin
Be Kotlineer - Be Simple - Be Connective.

2. BufferedWriter


import java.io.File

fun main(args: Array) {

val outString: String = "Kotlin\nBe Kotlineer - Be Simple - Be Connective."
File("kotlin2.txt").bufferedWriter().use { out -> out.write(outString) }

}

Check Result:

More at:

https://grokonez.com/kotlin/kotlin-write-file-kotlin-language

Kotlin – How to write to file with Kotlin language

kotlin write-file

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Kotlin - How to read/write Excel file with Apache POI » grokonez

Kotlin read write Excel file example - Kotlin read write Excel file Apache POI example - Kotlin Excel file example

Kotlin Properties - Read/Write Properties from/to .properties/.XML File - ozenero

In the post, we show how to Read/Write Properties from/to .Properties/.XML files by Kotlin language. I. Kotlin – Read/Write Properties from/to .Properties file 1. Write Properties to .Properties file 1.1 Properties store() method We use java.util.Properties.store() methods: // 1. fun store(out: OutputStream, comments: String): Unit -> Writes this property list (key and element pairs) in … Continue reading "Kotlin Properties – Read/Write Properties from/to .properties/.XML File"

How to read/write CSV file in Kotlin » grokonez

Kotlin read write CSV file example

Kotlin App Development Company in India, Hire Kotlin Developers

Looking for Kotlin app developers in India? We are the best kotlin app development company in India offering top notch kotlin based application development services.

Kotlin - How to read/write CSV file with OpenCSV » grokonez

Kotlin read write CSV file example - read write CSV file OpenCSV example