Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

string - right adjusted ?

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Feb 6, 2002
1,851
IL
HI,

I know how toleft adjust a string by padding it with spaces:
$TEMP = pack("A8",$TEMP);

But how do I right adjust it - padding spaces from the left ?
thanks

Long live king Moshiach !
 
To right-justify you need to use sprintf:
Code:
$TEMP = sprintf( '%8s', $TEMP );
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top