Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
quite plained
Source Link
mazzy
  • 7.2k
  • 2
  • 13
  • 23

You can use $s|% t*y instead [char[]]$s to split a string to char array. Given from TessellatingHeckler's answer: % t*y expands to | ForEach-Object -Method ToCharArray equiv. of "$args".ToCharArray()

% t*y expands to | ForEach-Object -Method ToCharArray equiv. of "$args".ToCharArray()

For example, compare

$s|% t*y

and

[char[]]$s

and

$s.ToCharArray()

It's useful with $args especially: $args|% t*y

You can use $s|% t*y instead [char[]]$s to split a string to char array. Given from TessellatingHeckler's answer:

% t*y expands to | ForEach-Object -Method ToCharArray equiv. of "$args".ToCharArray()

For example, compare

$s|% t*y

and

[char[]]$s

and

$s.ToCharArray()

It's useful with $args especially: $args|% t*y

You can use $s|% t*y instead [char[]]$s to split a string to char array. Given from TessellatingHeckler's answer: % t*y expands to | ForEach-Object -Method ToCharArray equiv. of "$args".ToCharArray()

For example, compare

$s|% t*y

and

[char[]]$s

and

$s.ToCharArray()

It's useful with $args especially: $args|% t*y

Source Link
mazzy
  • 7.2k
  • 2
  • 13
  • 23

You can use $s|% t*y instead [char[]]$s to split a string to char array. Given from TessellatingHeckler's answer:

% t*y expands to | ForEach-Object -Method ToCharArray equiv. of "$args".ToCharArray()

For example, compare

$s|% t*y

and

[char[]]$s

and

$s.ToCharArray()

It's useful with $args especially: $args|% t*y