Hello, so i am trying to create a line of dashes to separate different sections in the output of and i wanted to now if there is a way to repeated print ("-"); or something similar using the length on the longest line of text.
For Example
System.out.println ("Placeholder for Variables"); // this is shorter so it would not count the length of this text
System.out.println ("Are your trying to purchase a Ticket?"); // this is longer so it would count the length of this
System.out.println ("-------------------------------------"); // creates this line without having to be manually input like this to match the length of the text above
I know I could just manually make these lines but I plan on have statements with variables that change in length depending on user input so i want to make it generate these lines on its own.
Do not know if this would work since i am completely new to java, but i was thinking of making the lines of code where i concat a user input variable a string and get the length of that, but then again i have no idea how to do that and i still don't know how to make it create lines by itself.
If i provided to little info and you need something else just ask