Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 7th, 2005, 04:05 PM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default string manipulations in c#.

hello,

I am trying to run this code

string Word = "Egg"
string eis = word.IndexOf("E");
if (FirstChr=1)
{ // code}

But while building it, I get a message "cannot implicitly convert int to bool. Then I build it this way,

if (FirstChr==1)
{ // code}

and it runs without processing the code. I know this is wrong but I can't figure out the right answer. help!
 
Old January 7th, 2005, 06:20 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Does this actually compile?? In what environment? I find that hard to believe.

First of all word and Word are two different things. Then, the datatype for eis is incorrect, because IndexOf returns an int.

Next, what is FirstChr? Where did you declare it? You're not assigning it the return value of IndexOf if that's what you think.

If you fixed that, try to add something like this:

myLabel.Text = eis.ToString();

and you'll see where the error is.

I don't think this is related to the book ASP.NET Website Programming Prob-Design-Solution , so can you please post in a proper C# / .NET forum the next time? (I am sorry if this *is* related to the book though).

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Straight to You by Nick Cave & the Bad Seeds (Track 3 from the album: Henry's Dream) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding altered DOM after JavaScript Manipulations lorlarz Javascript How-To 4 December 8th, 2007 05:20 PM
how to find a string in another string in vb6 satish_k VB How-To 3 March 30th, 2007 12:17 PM
syntax to find a string in a string cole SQL Server 2000 2 October 10th, 2005 06:06 PM
how to replace a string with another string/number crmpicco Javascript How-To 4 March 14th, 2005 12:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.