I just tried this and this worked:

$username = "pattont"
$username[0]

This returned "p".

Results may vary though.

T


On 23 August 2013 11:03, James Rankin <[email protected]> wrote:

> Anyone have any ideas how to grab the first character of a string (namely
> a username) in PowerShell?
>
> Plenty of hits on removing the last characters from Google, but nothing
> useful
>
> Cheers,
>
>
>
> --
> *James Rankin*
> Technical Consultant (ACA, CCA, MCTS)
> http://appsensebigot.blogspot.co.uk
>

Reply via email to