'Java - Forward Slash Escape Character

Can anybody tell me how I use a forward slash escape character in Java. I know backward slash is \ \ but I've tried \ / and / / with no luck!

Here is my code:-

public boolean checkDate(String dateToCheck) {  
    if(dateToCheck.matches("[0-9][0-9]\ /[0-9][0-9]\ /[0-9][0-9][0-9][0-9]")) {
        return true;
    } // end if.
    return false;
} // end method.

Thanks in advance!



Solution 1:[1]

I wanted to write "n/a" and ended up with ""n\u002Fa""

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 P.Ellis