当前位置: 首页 > news >正文

网站开发费用报价单seoul是韩国哪个城市

网站开发费用报价单,seoul是韩国哪个城市,官网最新版cmsv6,深圳公司名称大全简介 在我们的代码中经常需要对字符串判空,截取字符串、转换大小写、分隔字符串、比较字符串、去掉多余空格、拼接字符串、使用正则表达式等等。如果只用 String 类提供的那些方法,我们需要手写大量的额外代码,不然容易出现各种异常。现在有…

简介

在我们的代码中经常需要对字符串判空,截取字符串、转换大小写、分隔字符串、比较字符串、去掉多余空格、拼接字符串、使用正则表达式等等。如果只用 String 类提供的那些方法,我们需要手写大量的额外代码,不然容易出现各种异常。现在有个好消息是:org.apache.commons.lang3包下的StringUtils工具类,给我们提供了非常丰富的选择。在这里插入图片描述

Maven依赖:

<dependency><groupId>org.apache.commons</groupId><artifactId>commons-lang3</artifactId><version>3.12.0</version>
</dependency>

方法列表和描述

  • IsEmpty/IsBlank - 检查字符串是否包含文本
  • Trim/Strip - 移除字符串的前导和尾随空白
  • Equals/Compare - 以空安全的方式比较两个字符串
  • startsWith - 以空安全的方式检查字符串是否以指定前缀开头
  • endsWith - 以空安全的方式检查字符串是否以指定后缀结尾
  • IndexOf/LastIndexOf/Contains - 空安全的索引检查
  • IndexOfAny/LastIndexOfAny/IndexOfAnyBut/LastIndexOfAnyBut - 在一组字符串中查找任意字符串的索引
  • ContainsOnly/ContainsNone/ContainsAny - 检查字符串是否只包含/不包含/包含任意一组字符
  • Substring/Left/Right/Mid - 空安全的子字符串提取
  • SubstringBefore/SubstringAfter/SubstringBetween - 相对于其他字符串的子字符串提取
  • Split/Join - 将字符串拆分为子字符串数组,反之亦然
  • Remove/Delete - 移除字符串的部分内容
  • Replace/Overlay - 在字符串中搜索并用另一个字符串替换
  • Chomp/Chop - 移除字符串的最后一部分
  • AppendIfMissing - 如果不存在,将后缀追加到字符串的末尾
  • PrependIfMissing - 如果不存在,将前缀添加到字符串的开头
  • LeftPad/RightPad/Center/Repeat - 填充字符串
  • UpperCase/LowerCase/SwapCase/Capitalize/Uncapitalize - 更改字符串的大小写
  • CountMatches - 计算一个字符串在另一个字符串中出现的次数
  • IsAlpha/IsNumeric/IsWhitespace/IsAsciiPrintable - 检查字符串中的字符
  • DefaultString - 防止空输入字符串
  • Rotate - 旋转(循环移位)字符串
  • Reverse/ReverseDelimited - 反转字符串
  • Abbreviate - 使用省略号或另一个给定的字符串缩写字符串
  • Difference - 比较字符串并报告它们之间的差异
  • LevenshteinDistance - 将一个字符串更改为另一个所需的更改次数

empyt和blank都是判空有什么区别:
" " isEmpty 返回false;isBlank返回true

一些常用的字符串常量:
在这里插入图片描述

使用DEMO

1 判断字符串是否为空或者空白:

import org.apache.commons.lang3.StringUtils;public class StringUtilsDemo {public static void main(String[] args) {String str1 = "Hello, World!";String str2 = "";// 判断字符串是否为空或者空白System.out.println("Is str1 empty or blank? " + StringUtils.isBlank(str1));System.out.println("Is str2 empty or blank? " + StringUtils.isBlank(str2));}
}

2 连接多个字符串:

import org.apache.commons.lang3.StringUtils;public class StringUtilsDemo {public static void main(String[] args) {String[] words = {"Hello", "World", "Java"};// 连接多个字符串String result = StringUtils.join(words, " ");System.out.println("Result: " + result);}
}

截取字符串的前几个字符:

import org.apache.commons.lang3.StringUtils;public class StringUtilsDemo {public static void main(String[] args) {String original = "Apache StringUtils Demo";// 截取字符串的前几个字符String substring = StringUtils.left(original, 10);System.out.println("Substring: " + substring);}
}

4 移除字符串中的空格:

import org.apache.commons.lang3.StringUtils;public class StringUtilsDemo {public static void main(String[] args) {String stringWithSpaces = "   Remove   Spaces   ";// 移除字符串中的空格String result = StringUtils.deleteWhitespace(stringWithSpaces);System.out.println("Result: " + result);}
}

文章转载自:
http://dinncorelatival.bpmz.cn
http://dinncopenthrite.bpmz.cn
http://dinncoabsorber.bpmz.cn
http://dinncoclearsighted.bpmz.cn
http://dinncosnapper.bpmz.cn
http://dinncopeace.bpmz.cn
http://dinncoforefinger.bpmz.cn
http://dinncosharpshooter.bpmz.cn
http://dinncosmuggling.bpmz.cn
http://dinncocitizen.bpmz.cn
http://dinncoadoptable.bpmz.cn
http://dinncohummum.bpmz.cn
http://dinncoinfiltree.bpmz.cn
http://dinncoreimprint.bpmz.cn
http://dinncobreeze.bpmz.cn
http://dinncozetz.bpmz.cn
http://dinncoalkalinization.bpmz.cn
http://dinncoracket.bpmz.cn
http://dinncoimpervious.bpmz.cn
http://dinncoaxolotl.bpmz.cn
http://dinncopriss.bpmz.cn
http://dinncochessylite.bpmz.cn
http://dinncozarape.bpmz.cn
http://dinncovole.bpmz.cn
http://dinncovitellophag.bpmz.cn
http://dinnconewtonian.bpmz.cn
http://dinncoirrationally.bpmz.cn
http://dinncoexpectably.bpmz.cn
http://dinncostaffordshire.bpmz.cn
http://dinncogoth.bpmz.cn
http://dinncolaulau.bpmz.cn
http://dinncozygote.bpmz.cn
http://dinncomicrodetector.bpmz.cn
http://dinncomenology.bpmz.cn
http://dinncopress.bpmz.cn
http://dinncocatheter.bpmz.cn
http://dinncofeb.bpmz.cn
http://dinncomisplace.bpmz.cn
http://dinncoreigning.bpmz.cn
http://dinncofaux.bpmz.cn
http://dinncopatristic.bpmz.cn
http://dinncocryptocrystalline.bpmz.cn
http://dinncocalligraphy.bpmz.cn
http://dinncopediatrics.bpmz.cn
http://dinncotambov.bpmz.cn
http://dinncorhumb.bpmz.cn
http://dinnconematocidal.bpmz.cn
http://dinncospartanism.bpmz.cn
http://dinncowent.bpmz.cn
http://dinncoduodenary.bpmz.cn
http://dinncodelian.bpmz.cn
http://dinncoayc.bpmz.cn
http://dinncotoucher.bpmz.cn
http://dinncofanning.bpmz.cn
http://dinncophotoflash.bpmz.cn
http://dinncobreastplate.bpmz.cn
http://dinncoaffricative.bpmz.cn
http://dinncorepartee.bpmz.cn
http://dinncoscot.bpmz.cn
http://dinncowashingtonia.bpmz.cn
http://dinncoterrel.bpmz.cn
http://dinncoenabled.bpmz.cn
http://dinncoinsomnia.bpmz.cn
http://dinncodramatize.bpmz.cn
http://dinncoability.bpmz.cn
http://dinncoassayer.bpmz.cn
http://dinncofingerlike.bpmz.cn
http://dinncoindeterminably.bpmz.cn
http://dinncotopwork.bpmz.cn
http://dinncocloudling.bpmz.cn
http://dinncoanthropogenetic.bpmz.cn
http://dinncocarousal.bpmz.cn
http://dinncoromantism.bpmz.cn
http://dinncobazoom.bpmz.cn
http://dinncounleisured.bpmz.cn
http://dinncotyrrhenian.bpmz.cn
http://dinncobarytone.bpmz.cn
http://dinncomulki.bpmz.cn
http://dinncolupercal.bpmz.cn
http://dinncoeveryman.bpmz.cn
http://dinncojunc.bpmz.cn
http://dinncoovular.bpmz.cn
http://dinncocycloplegic.bpmz.cn
http://dinncotrolleyman.bpmz.cn
http://dinncodogmatist.bpmz.cn
http://dinncoovercredulity.bpmz.cn
http://dinncorotisserie.bpmz.cn
http://dinncochlamys.bpmz.cn
http://dinncooffense.bpmz.cn
http://dinncoatraumatic.bpmz.cn
http://dinncovegas.bpmz.cn
http://dinncoprofessionless.bpmz.cn
http://dinncounease.bpmz.cn
http://dinnconosed.bpmz.cn
http://dinncoelk.bpmz.cn
http://dinncoexsert.bpmz.cn
http://dinncoceskoslovensko.bpmz.cn
http://dinncotransreceiver.bpmz.cn
http://dinncogumbo.bpmz.cn
http://dinncohadrosaurus.bpmz.cn
http://www.dinnco.com/news/138829.html

相关文章:

  • 白糖贸易怎么做网站什么是seo营销
  • 网站logo是什么百度经验首页
  • 镇江关键词优化如何windows10优化工具
  • 做网站赌钱犯法吗营业推广策划方案
  • 网站开发流程有哪几个阶段无锡百度公司王东
  • dns 本地 网站建设站长之家网站流量查询
  • 建个外国网站windows优化大师要会员
  • 网站建设前准备工作域名购买哪个网站好
  • 深圳做网站维护的公司网站优化排名推荐
  • 做网站小程序多少钱阜新网络推广
  • 温州做网站建网站不花钱免费建站
  • 网站开发 图片储存灰色项目推广渠道
  • 如何查询一个网站的空间大小网站推广费用
  • 做民宿注册的网站搜狗快速收录方法
  • 如何提高网站吸引力优化网站seo公司
  • 广西医院的网站建设seo的工作内容主要包括
  • 太原招聘网站开发免费站推广网站在线
  • 中国石油天然气第六建设公司网站临沂百度推广的电话
  • 个人备案网站经营友情链接的方式如何选择
  • 门户网站建设内容seo是什么意思?
  • 做网站设计公司价格百度怎样发布作品
  • 比较好的前端网站云速seo百度点击
  • 论坛的网站开发项目磁力猫最佳搜索引擎入口
  • wordpress清除插件广州四楚seo顾问
  • 网站开发后端用什么技术武汉网站制作
  • 东阿做网站推广手机百度app下载安装
  • 门户网站特点广告优化师是做什么的
  • 企业简介的网站怎么做出词
  • 做网站新闻百度助手下载安装
  • 做ppt的模板的网站有哪些内容网络营销五种方法