How to create range in Swift?

前端 未结 10 1498
时光说笑
时光说笑 2020-11-28 01:37

In Objective-c we create range by using NSRange

NSRange range;

So how to create range in Swift?

10条回答
  •  遥遥无期
    2020-11-28 02:14

    If anyone want to create NSRange object can create as:

    let range: NSRange = NSRange.init(location: 0, length: 5)
    

    this will create range with position 0 and length 5

提交回复
热议问题