473,395 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how to remove empty character literal error

1
Expand|Select|Wrap|Line Numbers
  1. import java .io.*;
  2. public class indranil
  3. {
  4.     public static void main(String args [])throws IOException
  5.     {
  6.       BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
  7.       int a,i,l,z;
  8.       System.out.println("enter a number a");
  9.  
  10.         a=Integer.parseInt(in.readLine());
  11.     l=a.length();
  12.     for(i=0;i<l;i++)
  13.     {
  14.      char ch=a.charAt(i);
  15.         if (ch=='')
  16.         {
  17.         z=z+1;
  18.     }
  19. }
  20.  
  21.         System.out.println("the number of spaces in sentence is"+z);
  22.  
  23.     }
  24. }
Dec 9 '13 #1
0 1199

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: ted | last post by:
I'm having trouble using the re module to remove empty lines in a file. Here's what I thought would work, but it doesn't: import re f = open("old_site/index.html") for line in f: line =...
3
by: Eranga | last post by:
What is empty character literal and how can we get rid of it. I want to check whether the text box is empty so I use if (TextBox1.Text == '' ) Why cant I do this? *** Sent via Developersdex...
9
by: VJ | last post by:
I have a property for a control ( source code not available) . The property accepts single char as value.. so I can set it to '/' or ':' or anything like that...At initialize of my From I want this...
1
by: shama | last post by:
Hi all, I am using BSTR data type for storing string and want to remove special character (# ' : )from that string. Is there any function for this.... As CString class has "SpanExcluding". or...
9
by: gvanosdol | last post by:
When on my development machine, I can execute the code in the subject (string strVarArr = strVar.Split('x');) without any problems. When I try to move the code to my server, I get "CS1011: Empty...
5
by: LEM | last post by:
Hi, I'm trying to remove any empty lines from a string, and I am doing the following: String pp; pp = "\r\n\r\n1\r\n23\r\n\r\n4"; pp = pp.Replace("\r\n\r\n", "\r\n");
4
by: sudhaMurugesan | last post by:
Hi all, I am importing data from excel sheet. i get the data in a datatable. when there are empty rows in excel i am getting empty rows in datatable also. how to remove empty rows? help me...
36
by: laredotornado | last post by:
Hi, I'm using PHP 5. I have an array of strings. What is the simplest way to remove the elements that are empty, i.e. where the expression "empty($elt)" returns true? Thanks, - Dave
2
by: zman77 | last post by:
Hello, I have a bunch of Image Buttons in my code. When I leave them as they are, I can build my project without problems. However, when I add OnClick to an image button, I get the error: Too...
1
by: srajendram | last post by:
cant assign to a literal error shows up. what am i doing wrong here please varA=5, varB='a' if type(varA) == str or type(varB) == str: print('string involved') elif varA > varB: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.