#include<stdio.h>
#include<ctype.h>
#define size 100
int main()
{
char s[size] = "Applea";
char c = "";
c = getchar();
int i, j;
int n = 100;
for (i = 0; i < n; i++)
{
if (s[i] == (char)c)
{
for (j = i; j < n; j++)
{
s[j] = s[j + 1];
}
n--;
j--;
}
printf("%c", s[i]);
}
return 0;
}
It's a function to remove certain characters from a string, but I heard it's case-sensitive due to the characteristics of the string
Currently, if you enter a, only a is erased, and A is not erased, but you do not use the string processing function.
Is there a way to remove both A and A when entering a?
string c function
#include <stdio.h>
int main()
{
char s;
s = 'Q';
if (s > 70 && s < 90) {
s = s + 32;
printf("%c", s); // "q"
}
return 0;
}
https://goodgid.github.io/ASCII-Code/
© 2024 OneMinuteCode. All rights reserved.