Solved

count characters in a file

Posted on 2002-04-14
3
172 Views
Last Modified: 2010-03-31
What is code for counting the number of characters in a file?
I've written out a file, now i want the number of characters in it.
0
Comment
Question by:xoxomos
3 Comments
 
LVL 9

Expert Comment

by:amx
Comment Utility
i'm assuming that if you have written out the file then you must have asssigned it to a String variable before printing out the file.

if you have then you could just find out the length of the string which would be the same as the number of characters.

0
 
LVL 92

Accepted Solution

by:
objects earned 25 total points
Comment Utility
file.length();
0
 

Author Comment

by:xoxomos
Comment Utility
Thanks, I don't know how this got in there 4 times.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
mergeTwo  challenge 13 71
basic hardware to learn oop advanced design patterns 3 72
count11 challenge 6 47
firstChar challenge 13 83
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now