Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,547 members, 7,955,034 topics. Date: Saturday, 21 September 2024 at 03:00 PM |
Nairaland Forum / Science/Technology / Webmasters / Java (644 Views)
(1) (Reply)
Java by HenryBios: 7:35am On Aug 17, 2010 |
import java.io.*; class FileRead { public static void main(String args[]) { try{ var iChars = "*|,\":<>[]{}`\';()@&$#%"; for (var i = 0; i < string.length; i++) { if (iChars.indexOf(string.charAt(i)) != -1){ System.out.println("Characters found" } catch (Exception e){ System.err.println("Error: " + e.getMessage()); } } } } Please let me know what is wrong with the above code. It is giving some compilation errors. I am trying to set an alert once I read the text file which contains special characters. Help!!!! |
Re: Java by sayhi2ay(m): 5:27pm On Aug 17, 2010 |
why not post the error along with your code? for (var i = 0; i < string.length; i++) { var i < string.length of what ? |
(1) (Reply)
Help Needed In Minisite Hosting / 100% Free Website Development Class / Check Out My Website
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 7 |