Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
simple shift
let shift (s:string) (k:int) =
System.String(
s.ToCharArray()
|> Array.map (function
| x when 'a' <= x && x <='z' ->
let code = int(x)-int('a')
char(int('a') + (code + k + 26) % 26)
| x -> x )
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment