Question: I want to leave a specific number of white spaces before printing a text

if i excecute :

```
System.out.printf("Some Text : ");
for (int stars = 0; stars < 5; stars++) { 
    System.out.print("*");
} 
System.out.println();

System.out.printf("Some Bigger Text : ");
for (int stars = 0; stars < 3; stars++) {
    System.out.print("*");
} 
System.out.println();

```

I will get te result :

```
Some Text : *****
Some Bigger Text : ***

```

But the output i want is

```
Some Text        : *****
Some Bigger Text : ***

```

NOTICE : I dont want to do something like

`System.out.printf("Some Text : ");`

Is there an other way?

I would appreciate your help!

Answer: 
You can use the formats of **printf**

```
package com.stackoverflow.question;

public class Main {

    public static void main(String[] args) {
        System.out.printf("%-30s : ", "Some Text"); //Justify left
        for (int stars = 0; stars < 5; stars++) { 
            System.out.print("*");
        } 
        System.out.println();

        System.out.printf("%-30s : ", "Some Bigger Text"); //Justify left
        for (int stars = 0; stars < 3; stars++) {
            System.out.print("*");
        } 
        System.out.println();
    }

}

```

**Output**

```
Some Text                      : *****
Some Bigger Text               : ***

```

**Additional info** - [Here](https://www.baeldung.com/java-printstream-printf)
You can search for the longest text (length) and then add the missing white spaces to your other text lines...