📄 substringexample.java
字号:
package examples.basic;
/** A class to demonstrate how to use String.substring
* method
*/
public class SubstringExample {
/** The test method for the class
* @param args Not used
*/
public static void main( String[] args ) {
String s1 = new String( "The quick brown fox" );
String s2 = s1.substring( 4, 8 );
String s3 = s1.substring( 4, 9 );
System.out.println( "The second word is " + s2 );
System.out.println( "The second word is " + s3 );
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -