user2131116
user2131116

Reputation: 2861

Can't split the text with white space

I want to split the text "Account D:\Bank\Account" with white space , so the parts will be Account and D:\Bank\Account , but it appear some error message , what's the problem?

here is my code

$Path_info = "Account D:\Bank\Account"
$Account = $Path_info.Split(" ")
write-host $Acoount[0]

error message

enter image description here

Upvotes: 1

Views: 63

Answers (1)

Marek Musielak
Marek Musielak

Reputation: 27132

You have a typo in

write-host $Acoount[0]

should be

write-host $Account[0]

Except for this, your code works fine.

Upvotes: 1

Related Questions