PC Review


Reply
Thread Tools Rate Thread

checking for paticular value

 
 
Vikas Kumar
Guest
Posts: n/a
 
      15th Jun 2006
i have string of first 5 numbers not necessary of length 5
eg: "1235" or "3421" or "12345"
now i want to check wether 3 is present in string or not
or 5 is present in given string or not
how can i do that


 
Reply With Quote
 
 
 
 
Dylan Parry
Guest
Posts: n/a
 
      15th Jun 2006
Vikas Kumar wrote:

> now i want to check wether 3 is present in string or not
> or 5 is present in given string or not


string myString = "54321";

if (myString.IndexOf("3") != -1) {
// 3 was in the string
}
else {
// 3 was not in the string
}

Just change the above to suit.

--
Dylan Parry
http://webpageworkshop.co.uk -- FREE Web tutorials and references
 
Reply With Quote
 
Vikas Kumar
Guest
Posts: n/a
 
      15th Jun 2006
thanks
"Dylan Parry" <(E-Mail Removed)> wrote in message
news:c3umngc6cjc3$.(E-Mail Removed)...
> Vikas Kumar wrote:
>
>> now i want to check wether 3 is present in string or not
>> or 5 is present in given string or not

>
> string myString = "54321";
>
> if (myString.IndexOf("3") != -1) {
> // 3 was in the string
> }
> else {
> // 3 was not in the string
> }
>
> Just change the above to suit.
>
> --
> Dylan Parry
> http://webpageworkshop.co.uk -- FREE Web tutorials and references



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Summing the number of paticular coloured cells gazoom Microsoft Excel Misc 1 19th May 2008 08:39 AM
Unable to access paticular public folder =?Utf-8?B?c2VraGFy?= Microsoft Outlook Discussion 0 1st Aug 2007 11:30 PM
Select paticular cells =?Utf-8?B?dmlqYXlh?= Microsoft Excel Programming 8 18th Nov 2005 04:26 PM
deleting a paticular version of a program =?Utf-8?B?SGVsbG8=?= Windows XP Help 0 3rd Jan 2004 09:06 PM
Set hotkey to open paticular note? MS Microsoft Outlook 0 29th Dec 2003 09:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:53 AM.