Range of an Array in SWIFT

0

I have an array of bytes and I need to find out what range (startindex and endindex) a byte is or if it only has startindex

ex:

var Faixa1:Array<UInt16> = [2,4,6,8,10,11,12]
var Faixa2:Array<UInt16> = [1,2]

var Valor1:UInt16 = 2
var Valor2:UInt16 = 3

//valor1 na faixa1
//startindex: 2
//endindex: 2

//valor1 na faixa2
//startindex: 2
//endindex: 2

//valor2 na faixa1
//startindex: 2
//endindex: 4
    
asked by anonymous 23.10.2018 / 21:19

0 answers