请删除文字为空的错误

请删除文字为空的错误

本文介绍了请删除文字为空的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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(" ");



这篇关于请删除文字为空的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 18:19