Click here to Skip to main content
13,193,468 members (51,895 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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
thanks a lot
Posted 10-May-12 3:00am
Updated 10-May-12 5:17am
B Birajdar 10-May-12 9:07am
not clear....
Ed Nutting 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?

Sandeep Mewara 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
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.
Rate this: bad
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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171018.2 | Last Updated 10 May 2012
Copyright © CodeProject, 1999-2017
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