还在学习中,我想把每天学到的一些知识记下来,这样可以加深记忆,以后也方便自己复习吧,加油!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace StringOperate
{
/// <summary>
/// 字符串 操作类
/// </summary>
class StrOperate
{
private static int count; //次数
public static int Count
{
get { return StrOperate.count; }
set { StrOperate.count = value; }
}
private string strContent; //字符串
public string StrContent
{
get { return strContent; }
set { strContent = value; }
}
private char searchChar; //需要查询的字符
public char SearchChar
{
get { return searchChar; }
set { searchChar = value; }
}
/// <summary>
/// 定义构造函数,初始化数据
/// </summary>
public StrOperate(string strContent, char searchChar)
{
this.strContent = strContent;
this.searchChar = searchChar;
}