StrCpy(vString,pString); //calls the function StrCpy to copy the string.

vLength=length; //to calculate the length of the string stored in the class.

vSize=vLength+1; //to calculate the size of the string.}

/** * Display() used to display the string stored in the class. * * @note * <ul> * <li>it also displays the length of the string stored. * <li>it also displays the memory allocated for the string to be stored. * </ul> * */

void Display(String& pString)

{ cout<<"\n The String Is "<<pString.vString; //displays the string stored in the class.

cout<<"\n The Length Of the String Is:- "<<pString.vLength; //displays the length of the stored string.

cout<<"\n The Size Of The String Is:- "<<pString.vSize; //displays the size of the stored string.}

/** * StrReverse () used to reverse the string stored in the class * */

void String::StrReverse(){char c; //variable initialization.

char *tail,*head; //pointer to a char initializations.

if(vString!=NULL){ head=vString; //allocates the starting address of the string to head.

tail=vString+StringLength(vString)-1; //allocates the ending address of the string to head.

//used to reverse the string .

while( head < tail ){ c = *tail; *(tail--) = *head; *(head++) = c;}

}else{

cout<<"REVERSING NOT POSSIBLE.N0 STRING PRESENT";

}}

/** * Trim () used to remove the spaces at the starting and ending of the string of the class. * * @note * <ul> * <li>it makes use of the lTrim to remove the starting spaces. * <li>it makes use of the rTrim to remove the ending spaces. * </ul> * */

void String::Trim(){//checks whether there is a space at the starting or not ,if present calls Ltrim.if(vString[0]==char(32))

Ltrim(vString); //calls the Ltrim function to remove the starting spaces.

//checks whether there is a space at the end or not ,if present calls Rtrim.if(vString[vLength-1]==char(32))

Rtrim(vString); //calls the Rtrim function to remove the ending spaces.

vLength=StringLength(vString); //calls the function StringLength to calculate the length of the string.

vSize=vLength+1; //to calculate the size of the string.}

/** * ConcatString () used to add a string into an existing string. * */

plength=StringLength(pString); //calls the function StringLength to calculate the length of the string pLength. vLength=StringLength(vString); //calls the function StringLength to calculate the length of the string vLength.

//checks whether the substring length is greater than the original string length.if(plength>vLength)return0;

//checks whether the substring is equal to the original string if their lengths are same.if(plength==vLength && strcmp(pString,vString)==0)return1;

//checks whether the substring is present in the original string when substring length is smaller than the original string length.for(k=0;k<=vLength;k++){

for(i=0;i<plength;i++){

if(vString[k+i]!=pString[i]){

break;

}else{

count++;

}if(count==plength){

return k+1;

break;}}}return0;}

/** * Delete () used to delete a part of the string stored in the class. * * @note * <ul> * <li>it searches a substring of the string and if found it deletes it. * <ul> * */