$foo = sprintf("%-10s", "Hello"); #### $String .= " " x (10-length($String));