₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,153 members, 8,420,583 topics. Date: Friday, 05 June 2026 at 04:26 AM

Toggle theme

Java - Webmasters - Nairaland

Nairaland ForumScience/TechnologyWebmastersJava (676 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

234

Review This Site PleaseCheap Website Registration For NigeriansI Will Design An Advert Banner For You @ N200 Per Client