📌  相关文章
📜  如何检查以 # 开头的字符串 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:28.555000             🧑  作者: Mango

代码示例1
public class JavaExample{  
   public static void main(String args[]){ 
    //given string
    String s = "   This is just a sample string";  
        
    //checking whether the given string starts with "This"
    System.out.println(s.startsWith("This"));  
        
    //checking whether the given string starts with "Hi"
    System.out.println(s.startsWith("Hi"));  
   }
}