返回一個新的字符串,它是此字符串的一個子字符串。該子字符串始于指定索引處的字符,向來到此字符串索引末尾。在SQLserver數據庫中,用于截取字符串的某部分。
public static void main(String[] args) {
// substring(beginIndex,endindex); 根據索引用來截取 String 類型的值 返回一個新的字符串
// 參數: beginIndex - 開始處的索引(包括)。
// endindex 結尾處索引(不包括)。
String s="abcdef"; //重
s= s.substring(1,5);
System.out.println(s);
}
substring雙語例句The Substring function will extract text from a source string.
Substring函數將從一個源字符串中提取文本。
Improved Algorithm for BM String Matching Based on Prefix Substring
基于前綴的BM串匹配改進算法
Scalable Distributed Data Structure for Substring Searching
具有子串檢索功能的可擴展分布式數據結構
Returns the index of the first character of a specified substring in a string.
返回指定子串首字符在串中的索引。
The length argument specifies the length of the desired substring.
長度參數指定了所需子字符串的長度。
來源:高三網
能發(fā)現自己知識上的薄弱環(huán)節(jié),在上課前補上這部分的知識,不使它成為聽課時的“絆腳石”。這樣,就會順利理解新知識,相信通過substring的用法 怎么截取字符串這篇文章能幫到你,在和好朋友分享的時候,也歡迎感興趣小伙伴們一起來探討。