달력

52024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

private bool IsNumeric(string text)
{
    return System.Text.RegularExpressions.Regex.IsMatch(text, "^\\d+$");
}

Left

public string Left(string Text, int TextLenth)
{
    string ConvertText;
    if (Text.Length < TextLenth)
    {
 TextLenth = Text.Length;
    }
    ConvertText = Text.Substring(0, TextLenth);
    return ConvertText;
}

 

Right

public string Right(string Text, int TextLenth)
{
    string ConvertText;
    if (Text.Length < TextLenth)
    {
 TextLenth = Text.Length;
    }
    ConvertText = Text.Substring(Text.Length - TextLenth, TextLenth);
    return ConvertText;
}

 

Mid

public string Mid(string Text, int Startint, int Endint)
{
    string ConvertText;
    if (Startint < Text.Length || Endint < Text.Length)
    {
 ConvertText = Text.Substring(Startint, Endint);
 return ConvertText;
    }
    else
 return Text;
}   

 

'Dev Language > C#' 카테고리의 다른 글

윈도우 플랫폼 체크  (0) 2015.12.31
Mac Address Changer(맥 어드레스 변경)  (0) 2015.12.30
.NET Decompile (닷텟 디컴파일)  (0) 2015.06.04
엑셀 exprot  (0) 2015.02.24
사운드 플레이,스톱  (0) 2015.02.24
Posted by 타카스 류지
|