当前位置:网站首页>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)
}
边栏推荐
- Alibaba is bigger than sending SMS (user microservice - message microservice)
- Eureka自我保护
- Recovery of website address and method of Amazon account login two-step verification failure caused by mobile phone number becoming empty
- Itext7 uses iexternalsignature container for signature and signature verification
- Idea packages the web project into a war package and deploys it to the server to run
- 【附下载】密码获取工具LaZagne安装及使用
- Sword finger offer07 Rebuild binary tree
- SLF4J 日志门面
- idea将web项目打包成war包并部署到服务器上运行
- How to deploy web pages to Alibaba cloud
猜你喜欢
记录自己vulnhub闯关记录
Idea packages the web project into a war package and deploys it to the server to run
What is more elegant for flutter to log out and confirm again?
使用BLoC 构建 Flutter的页面实例
If you can't learn, you have to learn. Jetpack compose writes an im app (II)
剑指Offer10- I. 斐波那契数列
Day 1 of kotlin learning: simple built-in types of kotlin
T430 toss and install OS majave 10.14
实现验证码验证
Sword finger offer03 Repeated numbers in the array [simple]
随机推荐
347. Top k high frequency elements
阿里大于发送短信(用户微服务--消息微服务)
网上炒股开户安不安全?谁给回答一下
Eureka self protection
Sword finger offer03 Repeated numbers in the array [simple]
Computer version wechat applet full screen display method, mobile phone horizontal screen method.
Nodejs+Express+MySQL实现登陆功能(含验证码)
Sword finger offer06 Print linked list from end to end
Flinksql can directly create tables and read MySQL or Kafka data on the client side, but how can it automatically flow and calculate?
Atomic atomic operation
[ManageEngine] the role of IP address scanning
云计算未来 — 云原生
Flutter: about monitoring on flutter applications
Alibaba is bigger than sending SMS (user microservice - message microservice)
257. All paths of binary tree
elastic_ L02_ install
ES6新特性
启用MemCached的SASL认证
Dart: About zone
145. Post order traversal of binary tree