题目:计算字符串中子串出现的次数 import java.util.*; public class lianxi49 { } ``` ...
分类:
其他好文 时间:
2018-10-24 01:04:46
阅读次数:
114
将json字符串转换为json对象的方法。在数据传输过程中,json是以文本,即字符串的形式传递的,而JS操作的是JSON对象,所以,JSON对象和JSON字符串之间的相互转换是关键 例如: JSON字符串:var str1 = '{ "name": "cxh", "sex": "man" }'; ...
分类:
Web程序 时间:
2018-10-21 00:53:00
阅读次数:
167
因为字符函数经常使用,所以把全部函数深入理解一遍。 记录下来方便之后查阅 ...
分类:
数据库 时间:
2018-10-20 13:44:46
阅读次数:
208
#————字符串转换为列表的三种方法————#方法一:通过.split转换为列表str0='a b c d e f'list0 = str0.split(' ')print(list0)#方法二:通过list直接转换为列表str1='qwerty'list1=list(str1)print(list ...
分类:
其他好文 时间:
2018-10-19 21:59:43
阅读次数:
154
以下列出mysql函数的使用,并不完全,涉及到多少写多少。 length(str):返回字符串(str)的字符长度。一个汉字算三个字符,一个数字或字母算一个字符。 char_length(str):返回字符串(str)的字符长度。一个汉字、数字或字母都算一个字符。 instr(str,substr) ...
分类:
数据库 时间:
2018-10-19 21:54:01
阅读次数:
209
def dec_hex(str1): #十转十六 a = str(hex(eval(str1))) b = a.replace("0x",'') print('十进制 \t%s\t十六进制\t%s'%(str1, a)) return b def hex_dec(str2): #十六转十 b = e... ...
分类:
其他好文 时间:
2018-10-17 11:13:13
阅读次数:
164
1)判断String类型的 s1 和 s2 是否相等 equals() 方法比较的是字符串的内容~所以结果是 true 很好理解,至于 str1==str2 的结果也是 true ,是因为在 Java 的内存的方法区中有一块区域叫做常量池,str1 =“abc” 时,常量池中没有 “abc”,所以就 ...
分类:
其他好文 时间:
2018-10-16 11:53:44
阅读次数:
160
函数list 有些时候修改字符串不能像列表那样,可以使用list来解决 list函数实际上是一个类,而不是函数。 somelist = list('hello') 字符串str1 = hello world, print(str1) ['h', 'e', 'l', 'l', 'o', ' ', 'w ...
分类:
编程语言 时间:
2018-10-15 14:35:42
阅读次数:
126
let str1 = 'abc'; let res1 = str1.charAt(2); let res2 = str1.charCodeAt(0); console.log(res1); //c console.log(res2); //97 let str1 = 'abca'; let res1 ...
public static void isprime() { int n;import java.util.Scanner; public class number { public static void main(String[] args) { int i = 0; System.out.pr... ...
分类:
其他好文 时间:
2018-10-14 20:53:19
阅读次数:
146