size_t trim (char *p)
{
char *from, *lim, *to;
from= p;
lim= p + strlen (p);
to= p;
while (lim>from && lim[-1]==' ') --lim;
while (from<lim && from[0]==' ') ++ from;
while (from<lim) *to++ = *from++;
*to= '\0';
return to-p;
}
String a=" Suraj "; String t=a.trim(); this will remove all the leading and trailing white spaces
GetA is a math function and not a string function.
The Perl Chomp function is a programming function that remove the "newline" character at the end of the string. One can use the Perl Chomp function to remove any character that has the same value as the current one.
The string function is strlength and it is evoked to return the length of a string.
Without any function is impossible. So I'll assume you mean any coded function, in which case the predefined function below is your answer.$string = strrev($string);
System.String.Trim() is an instance method that works on System.String objects. It removes any leading and trailing white space from the string. The MSDN article on this method can be found here: http://msdn.microsoft.com/en-us/library/t97s7bs3.aspx Example: void Main() { string classicFirstProgram = " Hello World! "; classicFirstProgram = classicFirstProgram.Trim(); Console.WriteLine(classicFirstProgram); }
string length is a function use to check the lenght of a string i.e number of alphabets in a word or sentence.
between parentheses: funname ("string")
shashi
The REPLACE function.
Use "+". Example: String string = "does this answer " + "your question?";
Hay buddy this is homework. U have to solve it by urself.