Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Help Simplifying Code

$
0
0

You can use array slicing on the string


$loginName = ($lastNameFiltered + “.” + $firstNameFiltered)[0..19] -join ''

That will produce the same result, but doesn’t fuss if the string is less than 20 characters.


Viewing all articles
Browse latest Browse all 13067

Trending Articles