Click here to Skip to main content
11,638,173 members (79,688 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET C#4.0
Hi,


This is my string value

string A="O10070-A-IT-03-DC-1000";

this is my another string value

string B="O10070-A-IT";

this is another string value

string C="03";
string D="DC";
string E="1000";


Here , Please observe my strings it's look like a B+C+D+E=A.
now i want to check the Value of A this is mixing of B,C,D,E or not.

please help me how to compare this....
Posted 17-Jan-13 17:38pm
Edited 17-Jan-13 18:04pm
v2
Comments
Shanu2rick at 17-Jan-13 23:44pm
   
What do you mean by comparison?
jibesh at 17-Jan-13 23:46pm
   
you can use the string.Compare function to compare the strings what do you want more than this?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Have a look at this[^]. You can compare any string you want.
  Permalink  
Comments
Shanu2rick at 18-Jan-13 0:08am
   
You can concate all(B,C,D,E) and then compare it with String A.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

hi,

you can used stringvalue.contains();

see below example----


if (stringValue.Contains(anotherStringValue))
{
    // Do Something //
}


hope this will help you!!!
  Permalink  
Comments
Madhuri Patil at 18-Jan-13 0:45am
   
Welcome;-)

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

  Print Answers RSS
0 jyo.net 348
1 Sergey Alexandrovich Kryukov 314
2 stibee 288
3 OriginalGriff 190
4 Mika Wendelius 185
0 OriginalGriff 9,051
1 Sergey Alexandrovich Kryukov 8,773
2 Mika Wendelius 7,034
3 Suvendu Shekhar Giri 2,425
4 F-ES Sitecore 2,408


Advertise | Privacy | Mobile
Web01 | 2.8.150728.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2015
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