如何使用c#将长字符串分成两部分 [英] how to divide long string in two parts using c#

查看:218
本文介绍了如何使用c#将长字符串分成两部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个发票,它生成了我必须将这个字符串分成两部分的单词。怎么做?在C#窗口应用程序

I have created invoice which generate the amount in words I have to divide this string in two parts. How to do? in C# window application

推荐答案



使用substring调用将字符串拆分为给定的索引。

例如:

Hi,
use the substring call to split the string at a given index.
for example:
string str = "780955" //780,955.00
string thousands = str.Substring(0, str.Length - 3);
string hundards = str.Substring(thousands.Length);





希望这会有所帮助。



问候

Jegan



Hope this helps.

Regards
Jegan


这篇关于如何使用c#将长字符串分成两部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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