I'm trying to implement a String method that can search a String and tell me whether it contains a '|' character at any index. I've found a method that might be useful, but can't seem to get the syntax right. The method is contains(CharSequence)... problem is I don't know what the heck a "CharSequence" is, nor how to code the '|' since I understand that to be a special character that requires special syntax. Here's what I tried:
String s = "hello|dsfds|dfadfa|dfafa";
char a = '|';
System.out.print(s.contains(CharSequence a));
doesn't work.
Any help?