regex - Java: Find Lines which start with double slashes "//" -


i'm goint read someline text file. want remove lines starts //. used below syntax find line not working. don't know right regex this. glad if can correct me:

if (line.startswith("//")){        /* related stuff*/        continue; } 

line.startswith("//") right way of checking if line starts in 2 forward slashes (demo).

if check same thing using regex, expression "^//.*$", ^ anchor stands beginning of line, $ stands end of line, , .* stands else in between (demo).


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -