Solved

count characters in a file

Posted on 2002-04-14
3
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Expert Comment

by:amx
ID: 6940992
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
ID: 6941013
file.length();
0
 

Author Comment

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

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
servlet example 11 75
check java version using powershell 13 457
ejb wildfly example 2 110
Java Restore security prompts not working 10 247
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

732 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