String substring

String path = "/tmp/***/a.ksh";
if (path.startsWith("/")) {
	path = path.substring(1);
	System.out.println("path: "+ path);
}

The output is:code

path: tmp/***/a.ksh

if the substring arg is 0, then the output is:string

// path = path.substring(0);
path: /tmp/***/a.ksh
相關文章
相關標籤/搜索