900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > kotlin字符串判空_Kotlin程序检查空字符串 空字符串或NULL字符串

kotlin字符串判空_Kotlin程序检查空字符串 空字符串或NULL字符串

时间:2024-02-15 01:21:12

相关推荐

kotlin字符串判空_Kotlin程序检查空字符串 空字符串或NULL字符串

kotlin字符串判空

Given a string, we have to check whether it is an empty, blank or NULL string.

给定一个字符串,我们必须检查它是否为空,空白或NULL字符串。

Example:

例:

Input:str = ""Output:True

用于在Kotlin中检查Empty,Blank或NULL字符串的程序 (Program to check for Empty, Blank or NULL string in Kotlin)

package com.includehelp.basic//Main Function, entry Point of Programfun main(args: Array<String>) {///Nullable Stringval s1: String?=null//Empty Stringval s2: String=""//Blank String, Contained only white spacesval s3=" "println("String s1 is isNullOrEmpty : ${s1.isNullOrEmpty()}")println("S

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。