₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,344,257 members, 8,510,879 topics. Date: Saturday, 31 October 2026 at 10:44 AM

Toggle theme

Java - Webmasters - Nairaland

Nairaland Forum › Science/Technology › Webmasters › Java (689 Views)

1 Reply

Java by HenryBios(op): 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

• 2 • 3 • 4

Programming Contest! • Webmaster Needed • www.babefishing.com: The Nigerian Free Dating Site, To Find Nigerian Free Match.