How to generate spaces from variable value

I’m trying to create a variable that through its value will create X space.

Example:

I declare a variable called space
This variable will receive a value number X
Depending on the number the variable receives, it needs to generate X white spaces.

If the space variable has the value 17 then it will generate 17 spaces.
If the space variable has the value 10 then it will generate 10 spaces.

I’ve had success using the Switch or IF function, but it doesn’t cover all possible scenarios because using Switch or IF I need to predict the possible values of the variable and that’s not feasible.

Does anyone have any tips on how to do this?

Thanks!