Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 4:00am
Edited 10-May-12 6:17am
v2
Comments
B Birajdar at 10-May-12 9:07am
   
not clear....
Ed Nutting at 10-May-12 9:08am
   
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 at 10-May-12 11:10am
   
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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Use strtok() and sprintf() if C++, or String.Split() and String.Format() if C# or VB.NET.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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
0 OriginalGriff 390
1 Jochen Arndt 150
2 Richard MacCutchan 135
3 DamithSL 95
4 Garth J Lancaster 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,260


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 10 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100