/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/fundamentals/runtime-libraries/snippets/System/String/Overview/fsharp/index2.fs
16 строк
451 B
Genevieve Warren
Add remarks for core types (#38970)
05 янв 2024, 22:14
Не верифицирован
05 янв 2024, 22:14
71d1377
Код
Авторство
О чём код?
module index2.fs open System // <Snippet5> let s1 = "This string consists of a single short sentence." let mutable nWords = 0 for ch in s1 do if Char.IsPunctuation ch || Char.IsWhiteSpace ch then nWords <- nWords + 1 printfn $"The sentence\n {s1}\nhas {nWords} words." // The example displays the following output: // The sentence // This string consists of a single short sentence. // has 8 words. // </Snippet5>