shiftc$(),shiftl$() and shiftr$()

string shiftc$( string strg(.) )
string shiftl$( string strg(.) )
string shiftr$( string strg(.) )

These return the specified string with certain adjustments. 
shiftc$() centers the string by equaling the number of leading and trailing spaces. If there is an odd number of spaces, the extra space becomes a trailing space. The returned string always has the same length as the input string. 
shiftl$() removes any leading spaces from the input string. 
shiftr$() moves the contents of the input string to the right, if there are trailing spaces. The length of the result is always the same as the length of the input string (this is not necessarily the declaration length). 

These functions do not change the input string.

shiftc$("  ABC      ")     | result  "    ABC    "
shiftl$("    ABC    ")     | result  "ABC    "
shiftr$("    ABC    ")     | result  "        ABC"

Related Post:

People who read this post also read :


Post a Comment


Twitter Delicious Facebook Digg Stumbleupon Favorites More