Skip to content

Instantly share code, notes, and snippets.

@shaneis
Last active November 23, 2018 15:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Have to use % to "go back to the start"
$String = 'SQL Server'
for ($i = 0; $i -lt $String.Length; $i++ ) {
[PSCustomObject]@{
'This Char' = $string[$i]
'Prev Char' = $string[$i -1]
'Next Char' = $string[($i +1) % $String.Length]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment