using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; internal class TranslaterClass { string mstrText; string mstrOriginal; //Control access to class-level variables. public string Text { get { return mstrText ; } set { mstrText = value; // keep a copy of the original Restore . mstrOriginal = value; } } //Restores translated text back to the original . public void Restore() { mstrText = mstrOriginal; } // Translates the value in the text property . public void Translate() { string strWord; string[] arrWords; bool bCaps = false; //Convert the string into an array using System.String. arrWords = mstrText.Split (error that empty character literral ) how it pics data at runtime ,, just bcs of this error , i m unable to run my web application) for(int intCount = 0; intCount <= arrWords.GetUpperBound(0));intCount++) { // Change to lowercase. strWord = arrWords[intCount].ToLower(); //Check if the word is capitalized . if(!arrWords[intCount].Equals(strWord)) bCaps = true; // Do the transalation. if(strWord != "") { strWord = strWord.Substring(1,strWord.Length - 1) + strWord.Substring(0,1) + "ay"; //Recapitalize if necessary . if(bCaps) strWord = strWord.Substring(0,1).ToUpper () + strWord.SubString(1,strWord.Length - 1); } // store the word back in the array arrWords[intCount] = strWord; //Reset the caps flag. bCaps = false; } //Rebuild the string from the array . mstrText = String.Join("",arrWords); } } please remove this error onlyy,,................ send me d corrected 1 , after removng error ... ohk , pls do that in free time , if u will get time.
arrWords = mstrText.Split(" ");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)