/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/fundamentals/runtime-libraries/snippets/System/AppContext/Overview/fsharp/Example6.fs
30 строк
719 B
Genevieve Warren
Add remarks for core types (#38970)
05 янв 2024, 22:14
Не верифицирован
05 янв 2024, 22:14
71d1377
Код
Авторство
О чём код?
module Example6 // <Snippet6> open System open System.Reflection [<assembly: AssemblyVersion("2.0.0.0")>] do () module StringLibrary = let substringStartsAt (fullString: string) (substr: string) = fullString.IndexOf(substr, StringComparison.CurrentCulture) // </Snippet6> // <Snippet7> let value = "The archaeologist" let substring = "archæ" let position = StringLibrary.substringStartsAt value substring if position >= 0 then printfn $"'{substring}' found in '{value}' starting at position {position}" else printfn $"'{substring}' not found in '{value}'" // The example displays the following output: // 'archæ' found in 'The archaeologist' starting at position 4 // </Snippet7>