横杠 字符串 字符
7.16 字符串格式化
* format ``` public class HelloWorld { public static void main(String args[]){ String name = "张三"; int age = 19; double score = 8.8; String str = Stri ......
7.15 字符串的截取
* substring , 经常结合indexOf,lastIndexOf 使用, ``` String str = "www.mldn.cn"; System.out.println(str.substring(4));// 4之后都截取 System.out.println(str.substr ......
删除字符串中相邻的重复字母
**题目**:去除字符串中相邻且相等的两个字母,得到一个新字符串,并重复进行该操作,知道不能删除为止。 **思路**:这道题首先想到的是利用循环,定义一个空的结果数组,遍历字符串的每一个元素,与结果数组中的最后一个元素比较,如果不相同,则追加该元素,反之删除数组最后一个元素。实现如下: ``` co ......
7.14 字符串拆分
* split ``` public class HelloWorld { public static void main(String args[]){ String str = "hello world hello mldn"; // split 按照指定字符串全部拆分 // String re ......
7.12 字符串查找
* contains indexOf, lastIndexOf,startsWith,endWith ``` public class HelloWorld { public static void main(String args[]){// String args[]字符串数组的意思 Strin ......
7.11 字符串比较
### demo1 equals equalsIgnoreCase ``` String strA = "mldn"; String strB = "MLDN"; System.out.println(strA.equals(strB)); System.out.println(strA.equal ......
7.10 字符串与字节
``` public class HelloWorld { public static void main(String args[]){// String args[]字符串数组的意思 String str = "helloworld"; byte data[] = str.getBytes(); ......
Java中输入字符串的方法
Scanner input = new scanner(); String code = input.next(); 错误写法://String code = input.toString(); 1、输入字符串 遇到空格或者换行结束 Scanner sc=new Scanner(System.in) ......
在开发过程中,C#中@的用法,对C#程序设计来说有不错的借鉴价值。一下介绍了四种用法。 @是取消字符串中的转义符。和斜杠作用一样,可以出来了字符串中的特殊子字符串
在开发过程中,C#中@的用法,对C#程序设计来说有不错的借鉴价值。一下介绍了四种用法。 原文链接:https://www.cnblogs.com/likui-bookHouse/p/9109872.html 在开发过程中,C#中@的用法,对C#程序设计来说有不错的借鉴价值。一下介绍了四种用法。 1、 ......
7.9 字符串与字符
### demo1 charAt ``` public class HelloWorld { public static void main(String args[]){// String args[]字符串数组的意思 String str = "www.baidu.com"; char c = ......
TDesign——投放时间段组件(48 * 7 位字符串)
# 前言 基于`tdesign vue-next + ts`实现 参考: [byte-weektime-picker](https://github.com/vincentzyc/byte-weektime-picker) # 内容 ``` 星期\时间 00:00 - 12:00 12:00 - 2 ......
关于SQL语句中-使用正则的方式匹配-排除包含任意字母点两个字符的字符串
今天对自己的一个数据库表中查询指定配置的实例信息,SQL语句如下: select * from aws_ec2_price where `year` = 1 and os_type = 'Windows' and vcpu = 16 order by memory ; 查询出来的结果如下(仅列出了部 ......
7.6 字符串修改分析
* String 内容不可修改 ``` public class HelloWorld { public static void main(String[] args){ String str = "www."; str += "mldn."; str += "cn"; System.out.pri ......
583. 两个字符串的删除操作
给定两个单词 word1 和 word2 ,返回使得 word1 和 word2 相同所需的最小步数。 每步 可以删除任意一个字符串中的一个字符。 ``` 示例 1: 输入: word1 = "sea", word2 = "eat" 输出: 2 解释: 第一步将 "sea" 变为 "ea" ,第二步 ......
7.5 字符串常量池
``` public class HelloWorld { public static void main(String[] args){ String info = "mldn"; String strA = "www.mldn.cn"; String strB = "www." + info + ......
7.2 字符串比较
### demo1 ``` public class HelloWorld { public static void main(String[] args){ String strA = "mldn";// 直接赋值定义字符串 String strB = new String("mldn");//构 ......
BigDecimal 转字符串,并去掉尾部的0
一、有一种写法,先转成Double BigDecimal target = new BigDecimal("5375130.000000"); String str = BigDecimal.valueOf(Double.parseDouble(target.toString())).toStrin ......
字符集问题(mybatis 插入mysql中文乱码,入参是中文)
1. 启动/停止/重启/状态 service mysqld start service mysqld stop service mysqld restart service mysqld status mysqld 是守护进程脚本,init.d 不是mysql的home 2. home/进入控制台 ......
C 风格字符串
C 风格的字符串起源于 C 语言,并在 C++ 中继续得到支持。字符串实际上是使用 null 字符 \0 终止的一维字符数组。因此,一个以 null 结尾的字符串,包含了组成字符串的字符。 下面的声明和初始化创建了一个 RUNOOB 字符串。由于在数组的末尾存储了空字符,所以字符数组的大小比单词 R ......
python中同时指定多个分隔符将字符串拆分为列表
001、 >>> str1 = "ab_cd ef_gh ij_kl" ## 测试字符串 >>> str1.split(" ") ## 一句空格进行拆分 ['ab_cd', 'ef_gh', 'ij_kl'] >>> import re >>> re.split("[_| ]",str1) ## 同 ......
BoolToStr、TBooleanHelper、Boolean 转 字符串
方法1:直接使用 BoolToStr procedure TForm3.btn1Click(Sender: TObject); var a, b: Boolean; begin a := True; b := False; mmo1.Lines.Add(BoolToStr(a, True)); mm ......
字符串有关的sprintf函数
sprintf函数的用法1、该函数包含在stdio.h的头文件中。2、sprintf和平时我们常用的printf函数的功能很相似。sprintf函数打印到字符串中(要注意字符串的长度要足够容纳打印的内容,否则会出现内存溢出),而printf函数打印输出到屏幕上。sprintf函数在我们完成其他数据类 ......
mysql utf-8 utf-8mb4字符集有哪些具体的区别
在 MySQL 中,UTF-8 和 UTF-8mb4 都是针对 Unicode 字符集的编码方式。它们之间的主要区别在于能够存储的字符范围不同。 UTF-8 编码使用 1 到 4 个字节来表示字符,其中大部分字符只需要 1 到 3 个字节,而只有一小部分需要 4 个字节来表示,这些字符包括一些较新的 ......
将字符串里的\x01,\x02这些替换掉用正则表达式无效?
大家好,我是皮皮。 ### 一、前言 前几天在Python白银群【凡人不烦人】问了一个`Python`正则表达式的问题,这里拿出来给大家分享下。 将字符串里的\x01,\x02这些替换掉用my_str = re.sub(r'\x0d', '', my_str)这个结果不对,是什么原因呢? 他的原始文 ......
C字符串函数(一)
# C字符串函数(一) > - `strlen()` -> 统计字符串长度 > - `strcat()`和`strncat()`函数 -> 拼接字符串函数 > - `strcmp()`和`strncmp()`函数 -> 字符串比较函数 > - `strcpy()`和`strncpy()`函数 -> ......