package com.zj.example.kotlin.shengshiyuan.helloworld

/**
 *
 * CreateTime: 18/5/29  10:25
 * @author 郑炯
 */

fun main(args: Array<String>) {
    val arr1 = arrayOf("hello", "world", "helloworld", "welcome")

    //输出所有包含"h"的字符串
    arr1.filter { it.contains("h") }.forEach { println(it) }

    println("---------------------------------------------")

    //输出长度大于5的字符串
    arr1.filter { it.length > 5 }.forEach { println(it) }

    println("---------------------------------------------")

    //将以字母d结尾的字符串,转换成大写的并输出
    arr1.filter { it.endsWith("d", ignoreCase = true) }.map { it.toUpperCase() }.forEach { println(it) }
}


class HelloKotlin55 {

}