Clear console

Hello everyone

Im a beginner at kotlin

I was wondering if there is any way to clear the output console, something similar to ‘clrscr()’ clear screen in C++ ?? or clear the console after a certain point, i.e. not clearing the whole console but instead clearing text after a certain part.

Thank you !

This SO thread has some answers for Java, I’d expect them to work the same way for Kotlin. java - How to clear the console? - Stack Overflow

Im working in IntelliJ IDE. the solution is not working

How’s this relevant?
It depends on what console you run your code on