MySQL 字符串截取函数:left(), right(), substring(), substring_index()。还有 mid(), substr()。其中,mid(), substr() 等价于 substring() 函数,substring() 的功能非常强大和灵活。 1、字符串截取 ...
分类:
数据库 时间:
2020-04-18 20:07:45
阅读次数:
92
题目 Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. 给定一个字符串 s,找到 s 中最长的回文子串。你可以假设 s ...
分类:
其他好文 时间:
2020-04-15 18:30:58
阅读次数:
59
"【简单】1 两数之和 Two Sum" "【中等】2 两数相加 Add Two Num" "【中等】3 无重复字符的最长子串 Longest Substring Without Repeating Characters" "【困难】4 寻找两个有序数组的中位数 Median of Two Sort ...
分类:
其他好文 时间:
2020-04-15 15:15:11
阅读次数:
70
sql还有个stuff的函数,很强悍。 一个列的格式是单引号后面跟着4位的数字,比如’0003,’0120,’4333,我要转换成3,120,4333这样的格式,就是去掉单引号和前导的0,用以下语句就可以。 SELECT stuff(substring([当前组织],2,4),1,patindex( ...
分类:
数据库 时间:
2020-04-14 19:00:46
阅读次数:
166
1408. String Matching in an Array Given an array of string words. Return all strings in words which is substring of another word in any order. String ...
分类:
其他好文 时间:
2020-04-12 18:45:33
阅读次数:
75
jdk1.6版本String.java文件中关于substring的代码及描述 1 /** 2 * Returns a new string that is a substring of this string. The 3 * substring begins with the character ...
分类:
其他好文 时间:
2020-04-11 23:50:12
阅读次数:
65
这是因为已经改变了xxx的值的类型,不再是字符串的话将不会拥有substring函数, 我当时这样写的时候,直接将number类型赋予了this.enter,所以导致了错误. 改为这样之后可以使用substring函数 得出结果:如果不能获取变量类型操作,有可能是因为变量类型并不是我所期待的变量类型 ...
分类:
其他好文 时间:
2020-04-08 19:26:20
阅读次数:
259
1.错误处理 try: print('try...') r = 10 / int('2') print('result:', r) except ValueError as e: print('ValueError:', e) except ZeroDivisionError: ##最后一个exce ...
分类:
编程语言 时间:
2020-04-08 12:03:13
阅读次数:
64
//转换为标准时区格式 2017-06-08T10:41:06+08:00 转换为2017-06-08T10:41:06+0800 String strValue = timeStr.substring(0, timeStr.lastIndexOf(":")) + timeStr.substring ...
分类:
其他好文 时间:
2020-04-07 22:44:03
阅读次数:
195