let colors =
"green orange red blue"
// Find first index of any of the letters in the char array.
let firstOfSet1 = colors.IndexOfAny [|'o'; 'b'|]
printfn
"First o or b: %d" firstOfSet1
printfn
"%s" (colors.Substring firstOfSet1)
// Use another char array.
let firstOfSet2 = colors.IndexOfAny [|'b'; 'g'|]
printfn
"First b or g: %d" firstOfSet2
printfn
"%s" (colors.Substring firstOfSet2)
// Use LastIndexOfAny.
let lastOfSet1 = colors.LastIndexOfAny [|'b'; 'l'; 'u'|]
printfn
"Last b or l or u: %d" lastOfSet1
printfn
"%s" (colors.Substring lastOfSet1)
First o or b: 6
orange red blue
First b or g: 0
green orange red blue
Last b or l or u: 19
ue