Click here to Skip to main content
15,918,267 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Posted
Comments
MalwareTrojan 4-Mar-13 8:14am    
How it should be divided?
I mean wise of 1/2 of length?
Member 9793793 4-Mar-13 8:18am    
example if it generate "seven lakh eighty thousand nine hundred and fifty five" then first four chunk at a line and remaining in next line
Maciej Los 4-Mar-13 8:14am    
Plase, be more specific and provide more details. It would be nice to see example data.
What have you done till now?
Member 9793793 4-Mar-13 8:18am    
example if it generate "seven lakh eighty thousand nine hundred and fifty five" then first four chunk at a line and remaining in next line

1 solution

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


Hope this helps.

Regards
Jegan
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900