Had more time to poke around the internet for string library commands. Not so much time that I verified my quick search theories though.
Though there is a way to do what I suggested using string.find, string.sub , etc, I found even more simple suggestion. string.format( %s, string), apparently, has a "limit' function for %s
For future reference, I think string.format( %<#>s, <nickname> ) would format <nickname> to # characters, AND, if less than #, PAD with spaces. Meaning, string would always be that number of characters after the format.
In theory, could use something like this to pass to your text. You'd still need to figure out max/best #.
player_name = ply:Name()
if string.len( player_name ) > <some #> then
player_name = string.format ( %<some # -3>s, player_name ) .. "..." -- this name is static <#> characters and truncated including the ...
else
player_name = string.format ( %<some #>s, player_name ) -- this name is static and includes spaces up to #.
end
EDIT - USE a "-" in front of the <some #> if you want LEFT justified, other wise it's RIGHT justified.
So, example, you want 30 characters of space.
My name in Steam is [ULX]JamminR
> string.format( "%30s", "[ULX]JamminR" )
= " [ULX]JamminR"
> string.format( "%-30s", "[ULX]JamminR" )
= "[ULX]JamminR "
Might be off a bit, but, you get the ideas.
Nice formatted page here -
http://wiki.roblox.com/index.php?title=String_Formatting