您的位置:首页 > 编程语言 > C#

C#-截取字符串----ShinePans

2014-04-03 20:17 267 查看
//format的使用
//查询今天的日期
//截取字符串
using System;
class program
{
static void Main()
{

string strAllPath = "D:\\C# ABCD\\C# abcd.exe";
string strPath = strAllPath.Substring(0, strAllPath.LastIndexOf("\\") + 1);
string strName = strAllPath.Substring(strAllPath.LastIndexOf("\\") + 1);
Console.WriteLine("文件路径:",strPath);
Console.WriteLine("文件名:", strName);
Console.ReadLine();
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: