Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello

please I try to cut my string in c#

my string is ASP-CCNA-Oracle

string Mytext ="ASP-CCNA-Oracle";

so I need the output like

string A ="ASP";
string B = "CCNA";
string C="Oracle";

how can I do that using c# code ?
Posted
Updated 24-Jul-14 21:22pm
v3
Comments
CHill60 24-Jul-14 20:10pm    
String.Split... can't do much more from my phone sorry

1 solution

C#
string Mytext ="ASP-CCNA-Oracle";
string[] items = MyText.Split('-');
string A = items[0];
string B = items[1];
string C = items[2];
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-Jul-14 3:21am    
Sure, a 5.
—SA
CHill60 25-Jul-14 5:59am    
5

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