PS C:\> $mytext = 'Test' PS C:\> $paddedText = $mytext.PadLeft(15) PS C:\> "Here is the text: '$paddedText'" Here is the text: ' Test' PS C:\> PS C:\> $paddedText = $mytext.PadRight(15) PS C:\> "Here is the text: '$paddedText'" Here is the text: 'Test ' |
PS C:\> 'Hello'.PadLeft(20, '.') ...............Hello PS C:\> 'Hello'.PadRight(20, '_') Hello_______________ |
欢迎光临 批处理之家 (http://bbs.bathome.net/) | Powered by Discuz! 7.2 |