|
Cet article a fait l'objet d'une traduction manuelle. Déplacez votre pointeur sur les phrases de l'article pour voir la version originale de ce texte. Informations supplémentaires.
|
Traduction
Source
|
Chaînes (F#)
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Using a verbatim string let xmlFragment1 = @"<book author=""Milton, John"" title=""Paradise Lost"">" // Using a triple-quoted string let xmlFragment2 = """<book author="Milton, John" title="Paradise Lost">"""
let str1 = "abc def" let str2 = "abc\ def"
printfn "%c" str1.[1]
printfn "%s" (str1.[0..2]) printfn "%s" (str2.[3..5])
abc def
// "abc" interpreted as a Unicode string. let str1 : string = "abc" // "abc" interpreted as an ASCII byte array. let bytearray : byte[] = "abc"B
let printChar (str : string) (index : int) = printfn "First character: %c" (str.Chars(index))