RemoveSpaces (char *str) {
char *new = str;
while (*str != '\0') {
if (*str != ' ') *(new++) = *str;
str++;
}
*new = '\0';
}
.... String line = "This is example program with spaces"; String[] tokens = line.split(" "); System.out.println(tokens.length-1); .......
a promlem to solve an equation or a assigment
One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.
You usually do not need to delete a String, since when the program no longer refers to it, the garbage collector will clean it up.
This functionality is already in Java. String.toLowerCase() and String.toUpperCase() will take care of it for you.
.... String line = "This is example program with spaces"; String[] tokens = line.split(" "); System.out.println(tokens.length-1); .......
a promlem to solve an equation or a assigment
No.
One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.
You usually do not need to delete a String, since when the program no longer refers to it, the garbage collector will clean it up.
This functionality is already in Java. String.toLowerCase() and String.toUpperCase() will take care of it for you.
8086 assembly language program to check wether given number is perfect or not
You find a language that can be targeted towards the .NET Framework. What you are suggesting is something related to string manipulation and you can work with delimiters.
Check the documentation of the String class, for a method that searches for a substring.
/*We can calculate this with a lot of methods I'll explain only one of them */ *str = "abcd"; // this is a input string printf("%d", strlen(str));
Use the tolower() function. Example: char* a = 'X'; a = tolower(a); printf("%c", a);
Yes, you can use regex to determine if a given string is a palindrome by reversing the string and then comparing it to the original string using regex.