第3节 JAVA数组向量字符串.pptVIP

  • 30
  • 0
  • 约2.3万字
  • 约 96页
  • 2017-06-03 发布于湖北
  • 举报
任务 类String字符串定义 可以用字符串常量直接初始化一个String对象 String s = Hello World ; 通过构造方法 字符串变量和普通变量的区别 String构造方法的使用举例 String的常用方法—字符串长度 String的常用方法—字符串比较 字符串比较举例 字符串比较方法 搜索字符和字符串 搜索字符和字符串 搜索字符串举例_判断邮箱正确性 字符串提取、连接、替换等方法 字符串应用举例 更改字符大小写方法 更改字符大小写方法举例 任务实现:分离文件名和路径 public class GetFilename{ private String fullPath; private char pathSepatator=\\; public GetFilename(String fname){ fullPath=fname; } public String getName(){ int pos=fullPath.lastIndexOf(pathSepatator); if (pos==-1) { return fullPath; } else { return fullPath.substring(pos+1);

文档评论(0)

1亿VIP精品文档

相关文档