Hey guys, I'm trying to create my own personal API (more like a simple way for me to write long codes), and i've run into a snag. I want to create a simple function to detect whether or not I want the consoleWrite() to print out a new line system out, or to keep it on the same line.
I.E: When the users prompts to exit the terminal, it comes up with a
Are you sure you want to exit? (Y/N)
and I want it to stay on the same line, so the Y or N comes right after the output.
I have some kind of idea on how to do this, like, in the function to prompt for the same line, it could be something like this..
consoleWrite("Hello World!", "null");
But how do I make my API program detect if the code contains the "null" part or not and then print out the correct system out? I know this will include an "if" statement, but that's as far as I know. Any help on this will be perfect!