You are here:

C/ask a question

Advertisement


Question
sir,
   if i want to delete unnecessary space from the entered string then which code or condition i have to apply

    example::
            i have entered "how   it works  so    fast" and i get output in this way "how it works so fast" then please give me code or solution for these problem.

Answer
hi Tushar

The function you are talking about is know as trim function that deletes spaces from the front and back and any two consecutive spaces in between this function is there in all the languages other than C/C++. In case if you need it in C/C++ you have to write your function for this.

i have once implemented all the function of C in a file called string.h I am giving you the link please check the trim function from this program.

http://www.scodz.com/ViewProgram.php?uid=2&link=178

In case of any difficulty please feel free to get back to me.

regards
Joydeep Bhattacharya
http://www.scodz.com

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Joydeep Bhattacharya

Expertise

Ability to solve C and Data Structure problems and puzzles with simple and easy to understand logic.

Experience

C, C++, Java, Data Structure, PHP, Web Designing

Organizations
http://www.scodz.com Designation: webmaster

Publications
http://www.scodz.com

Education/Credentials
Master of Computer Applications

Past/Present Clients
http://analysingc.50webs.com http://www.funforu.com

©2012 About.com, a part of The New York Times Company. All rights reserved.