当前位置:网站首页>It feels great to know you learned something, isn‘t it?
It feels great to know you learned something, isn‘t it?
2022-07-03 12:35:00 【iWillook】
//
// main.swift
// Ultimate
//
// Created by Mewlan Musajan on 4/26/21.
//
//Excerpt From: Apple Inc. “The Swift Programming Language (Swift 5.3).” Apple Books. https://books.apple.com/us/book/the-swift-programming-language-swift-5-3/id881256329
func findAnyTypeOfIndex<T: Equatable>(of valueToFind: T, in array:[T]) -> Int? {
for (index, value) in array.enumerated() {
if value == valueToFind {
return index
}
}
return nil
}
let someIntValues = [1, 2, 3, 4, 5]
if let intValue = findAnyTypeOfIndex(of: 2, in: someIntValues) {
print(intValue)
}
边栏推荐
猜你喜欢
![Sword finger offer04 Search in two-dimensional array [medium]](/img/c4/002c951f8d914aaea4f4133685ebd1.png)
Sword finger offer04 Search in two-dimensional array [medium]

Itext7 uses iexternalsignature container for signature and signature verification

(construction notes) ADT and OOP

Sword finger offer06 Print linked list from end to end

剑指Offer07. 重建二叉树

Shutter widget: centerslice attribute

Self made pop-up input box, input text, and click to complete the event.

Sword finger offer10- I. Fibonacci sequence

Integer string int mutual conversion

Record your vulnhub breakthrough record
随机推荐
Sword finger offer10- I. Fibonacci sequence
node的ORM使用-Sequelize
1-1 token
T430 toss and install OS majave 10.14
With pictures and texts, summarize the basic review of C language in detail, so that all kinds of knowledge points are clear at a glance?
(construction notes) grasp learning experience
Use Tencent cloud IOT platform to connect custom esp8266 IOT devices (realized by Tencent continuous control switch)
Solve the problem of VI opening files with ^m at the end
写一个简单的nodejs脚本
If you can't learn, you have to learn. Jetpack compose writes an im app (II)
MySQL time zone solution
剑指Offer06. 从尾到头打印链表
Sword finger offer09 Implementing queues with two stacks
启用MemCached的SASL认证
1-2 project technology selection and structure
GCN thinking - word2vec directly calculates text classification
Applet wxss introduction
Shutter: about inheritedwidget
Cloud Computing future - native Cloud
Introduction to concurrent programming (II)