![]() |
String problem
Hi all,
I want remove tail end whitespace from string in c.for example- i/p string is "today is monday "and o/p string is "today is monday" plz help asap. thanks in advance.... |
Re: String problem
It's not difficult. Where are you stuck?
Generally the algorithm for this would be: find the last character in the string if it's a space, replace it with \0 repeat until the last character in the string isn't a space. |
Re: String problem
See the following Example C program to remove the training space.
Code:
#include<stdio.h>Code:
welcome to go4Expert ======= |
Re: String problem
i have written 3 general functions regarding trims
check this Code:
#include <stdio.h> |
Re: String problem
Hope this is a better way
Code:
#include<stdio.h> |
Re: String problem
See the following Example C program to remove the training space.
Code: Code:
#include<stdio.h>Code: Code:
welcome to go4Expert =======Note: Last post for This node I did a mistake in coding. Now I correct it and I highlight that in code. |
| All times are GMT +5.5. The time now is 10:04. |