Remove Spaces from String | Logical Programming in C | Naresh IT

preview_player
Показать описание

Subscribe to our channel and hit the bell 🔔🔔🔔 icon to get video updates.

💡 Visit Our Websites

--------------------------

💡 About NareshIT:

"Naresh IT is having 14+ years of experience in software training industry and the best Software Training Institute for online training, classroom training, weekend training, corporate training of Hadoop, Salesforce, AWS, DevOps, Spark, Data Science, Python, Tableau, RPA , Java, C#.NET, ASP.NET, Oracle, Testing Tools, Silver light, Linq, SQL Server, Selenium, Android, iPhone, C Language, C++, PHP and Digital Marketing in USA, Hyderabad, Chennai and Vijayawada, Bangalore India which provides online training across all the locations

--------------------------

💡 Our Online Training Features:
🎈 Training with Real-Time Experts
🎈 Industry Specific Scenario’s
🎈 Flexible Timings
🎈 Soft Copy of Material
🎈 Share Videos of each and every session.

--------------------------

💡 Please write back to us at

--------------------------

💡 Check The Below Links

Рекомендации по теме
Комментарии
Автор

There is a error in the code if we simply use strlen after we get the input through scanf function where the string has spaces the string length will be only upto the character before the spaces. eg for ( a space b) strlen will be only 1 not 3.

prathishm
Автор

Two spaces can exist adjacently, to overcome this problem we must put i--; in the if statement's body.

onurinancdogruyol
Автор

Sir you already said in strings handling videos part 2 ..that strlen function gives the length of the string " Excluding null character" But in this you explained that alternatively...which one is correct sir...🤔🤔

kishorep
Автор

Bro, keep putting more videos, u are clear explainer...thank you so much

kamaleshs
Автор

Hiii sir
Tq Soo much sir .... E videos naku chalaaa help indi..
Sir meru '.net ' cheputaraa....?

dspdev
Автор

#include <stdio.h>
#include<string.h>
int main() {
char inputString[100], outputString[100];
int i, j;
printf("Enter a string with spaces: ");
fgets(inputString, sizeof(inputString), stdin);
for (i = 0, j = 0; inputString[i] != '\0'; i++) {
if (inputString[i] != ' ') {
outputString[j++] = inputString[i];
}
}
outputString[j] = '\0';
printf("String without spaces: %s\n", outputString);
return 0;
}
its the correct code for this question

manjunadhareddysithara
Автор

Ty sir great explanation, was looking for this❤

nischay
Автор

#include <stdio.h>
#include <string.h>

int main() {
char input[100], output[100];
int i, j;

printf("Enter a string: ");
gets(input);

for (i = 0, j = 0; i < strlen(input); i++) {
if (input[i] != ' ') {
output[j] = input[i];
j++;
}
}

output[j] = '\0';

printf("String without spaces: %s\n", output);

return 0;
}

loopNlogic
Автор

Great explaination Sir
Thank you so much Sir
🙏🙏🙏🙏🙏🙏🙏🙏

Suniyedekhiye
Автор

great explanation and more effeftive video in youtube .🤟🏼🤟🏼

nirupomchowdhury
Автор

everything was perfect but strlen does not count null character so the lenght would be 5 only

everythingishere
Автор

Sir,
What will happen if there is 2 or more adjacent spaces?
Please explain sir

raveenak
Автор

This code doesn't work for two or more spaces in between string or at start for eg. if a string is : i am a student then output is : i amastudent ....
one space is still present. kindly provide solution for this.

sarveshsawant
Автор

I think strlen function returns the length of the string except null character

Raam
Автор

thank you very much sir for this video

saddamahmad
Автор

Sir how to shift hyphen to front of the string? Please make a video of this. I'm giving an example:
input: hello-hi-there
output: --hellohithere

PLease please make a video of this.

madhurimadas
Автор

write a function to remove slash from two string and call that function from strcmp function and compare it in c programming??

TrickyTech
Автор

Gets function is not allowed in c sir

siddharathasoam
Автор

Sir do a video on string rev without using string functions

nikhileshyoutube
Автор

Wrng for loop conditions
Bro check once

shaiknoorul
visit shbcf.ru