I am a Java Newbie by the way, please go easy on me!
What I want to do: If a string is less than 10 characters, add enough characters to make it equal to 10 characters
My code so far, I know the last few lines especially this one: int theActualLength = 10 - length is probably wrong! and my indentation and closing braces are incorrect, I will fix them later - many thanks in advance!
public class Sample_String {
public static void main(String[] args) {
String newString = "testing";
int length = newString.length();
if (newString.length() < 10) {
int theActualLength = 10 - length
for(theActualLength = 0; i<10; i++){
System.out.println("The length of the newString is now: "+theActualLength);
}
}