Created
April 6, 2013 15:28
-
-
Save zaneli/5326478 to your computer and use it in GitHub Desktop.
「「C#で学ぶF#入門」復習メモ」ブログ用
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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