Warcraft III resources & community, 2003–2006 · archived

StringAbbreviate

not rated
Submitted by AltSubmitterText Parsing0 downloads
Pretty simple function, basically used for abbreviating player names for multiboards, because unlike leaderboards they won't cutoff the player name automatically if it's larger than your leaderboard size..

Source

function StringAbbreviate takes string whichString, integer cutoff returns string
    if(StringLength(whichString) > cutoff) then
        return SubStringBJ(whichString, 1, (cutoff - 3)) + "..."
    endif

    return whichString
endfunction

Comments

1
EXTREMELY easy to do, but still good for people that dont know any Jass. I think for them, itd be a 5/5. Im not going to rate it down just b/c i dont need it though