2 people like it.

Palindrom

Check string of palindroms

1: 
2: 
3: 
let IsPalindrom (str:string)=
  let rec fn(a,b)=a>b||str.[a]=str.[b]&&fn(a+1,b-1)
  fn(0,str.Length-1)
val IsPalindrom : str:string -> bool

Full name: Script.IsPalindrom
val str : string
Multiple items
val string : value:'T -> string

Full name: Microsoft.FSharp.Core.Operators.string

--------------------
type string = System.String

Full name: Microsoft.FSharp.Core.string
val fn : (int * int -> bool)
val a : int
val b : int
property System.String.Length: int

More information

Link:http://fssnip.net/mu
Posted:9 years ago
Author:Zhukoff Dima
Tags: recursion