Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,155,524 members, 7,826,965 topics. Date: Tuesday, 14 May 2024 at 01:13 AM

Java - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Java (633 Views)

(2) (3) (4)

(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"wink;
}


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)

***make Money With Facebook Apps For Webmasters***** / N8k Per Year Reseller Account / Is Affiliate Marketing Dead In 2011?

(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. 4
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.