在C#中获取字符串的一部分 [英] To get a part of the string in C#

查看:80
本文介绍了在C#中获取字符串的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



在C#代码中我有一个字符串,即C:\ Users \ indrajit.dasgupta \Desktop \ WeitronExcel.xls从那个我只需要WeitronExcel字符串的一部分。







感谢All





Indrajit Dasgupta



我尝试了什么:



我有一个字符串即C:\ Users \ indrajit.dasgupta \Desktop \ WeitronExcel.xls,我只需要WeitronExcel 字符串的一部分

Hi All,

In C# Code I have a string i.e. "C:\Users\indrajit.dasgupta\Desktop\WeitronExcel.xls " from that I need only "WeitronExcel" part of the string.



Thanks to All


Indrajit Dasgupta

What I have tried:

I have a string i.e. "C:\Users\indrajit.dasgupta\Desktop\WeitronExcel.xls " from that I need only "WeitronExcel" part of the string

推荐答案

Path.GetFileNameWithoutExtension Method(String)(System.IO) [ ^ ]。


这篇关于在C#中获取字符串的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆