Skip to content

Instantly share code, notes, and snippets.

@zaneli
Created April 6, 2013 15:28
Show Gist options
  • Save zaneli/5326478 to your computer and use it in GitHub Desktop.
Save zaneli/5326478 to your computer and use it in GitHub Desktop.
「「C#で学ぶF#入門」復習メモ」ブログ用
open System
let rec getNumIndex (line:string) index =
if index < line.Length then
if (Char.IsNumber(line.[index])) then getNumIndex line (index + 1) else index
else
index
let rec loop () =
let line = Console.ReadLine()
if line <> null then
let index = getNumIndex line 0
Console.WriteLine(line.[0 .. index - 1])
loop ()
loop ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment