Click here to Skip to main content
Sign Up to vote bad
good
See more: Parsing
hi
i got this sentence such as (p1 and p2),i want to keep Structure , i only want to replace p1,p2 to my own variable and change it this sentence for example (v1 and v2),and my Language is c#.net
thanks a lot
Posted 10 May '12 - 3:00
Edited 10 May '12 - 5:17

Comments
B Birajdar - 10 May '12 - 9:07
not clear....
Ed Nutting - 10 May '12 - 9:08
This is very unclear. Please improve your question - at the moment I have no clue what you are trying to do. What sort of sentence? An English sentence or is this some form of sentence you've made up? Thanks, Ed
Sandeep Mewara - 10 May '12 - 11:10
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific. Use the "Improve question" link to edit your question and provide better information.

2 solutions

Use strtok() and sprintf() if C++, or String.Split() and String.Format() if C# or VB.NET.
  Permalink  
As you haven't stated what your requirements really are, given the problem description you've shown you could simply replace the comma with and in a straightforward text replacement. For instance (and I'm assuming C# here since you haven't even said which language:
string text = "V1,V2";
Console.WriteLine(string.Replace(",", " and ");
You really need to say what your requirements really are before you'll get much better as an answer.
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 464
1 Mahesh Bailwal 373
2 Maciej Los 215
3 CPallini 175
4 Rohan Leuva 175
0 Sergey Alexandrovich Kryukov 9,402
1 OriginalGriff 7,204
2 CPallini 3,933
3 Rohan Leuva 3,211
4 Maciej Los 2,743


Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 10 May 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid