lastIndexOf();表示获取字符串最后出现的位置,倒数的位置
  

@Test
	/**
	 * lastIndexOf();//获取字符串最后出现的位置,倒数的位置
	 * */
	public void funC() {
		String str = "java培优+.java高手加薪班宣讲.mp4";
		System.out.println(str);
		System.out.println(this.getName(str));
		
	}
	
	public String getName(String filName) {
		int pos = filName.lastIndexOf(".");
		String extName = filName.substring(pos+1);
		return extName;
	}

  

相关文章:

  • 2022-12-23
  • 2021-12-13
  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
猜你喜欢
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案