Click here to Skip to main content
15,912,932 members
Home / Discussions / C#
   

C#

 
GeneralRe: Rich Edit TextBox Pin
Anonymous9-Jul-05 12:14
Anonymous9-Jul-05 12:14 
GeneralAccessing the parallel port Pin
asif amjad9-Jul-05 9:22
asif amjad9-Jul-05 9:22 
GeneralRe: Accessing the parallel port Pin
Anonymous9-Jul-05 11:38
Anonymous9-Jul-05 11:38 
GeneralRemoving selected text from a string Pin
Member 20300389-Jul-05 8:19
Member 20300389-Jul-05 8:19 
GeneralRe: Removing selected text from a string Pin
Snowblind379-Jul-05 8:29
Snowblind379-Jul-05 8:29 
GeneralRe: Removing selected text from a string Pin
User 66589-Jul-05 8:34
User 66589-Jul-05 8:34 
GeneralRe: Removing selected text from a string Pin
Member 20300389-Jul-05 8:48
Member 20300389-Jul-05 8:48 
GeneralRe: Removing selected text from a string Pin
Guffa9-Jul-05 8:38
Guffa9-Jul-05 8:38 
The IndexOf method returns -1 when the string is not found. You have to check if the word is even present in the string before you try to remove it.

Also, your method is only removing the first occurance of the word. Why don't you use a Replace instead? Or why not use a regular expression? Then you can match the word boundaries, so that you don't accidentally remove a part of a word that matches another word.

---
b { font-weight: normal; }

GeneralRe: Removing selected text from a string Pin
Member 20300389-Jul-05 8:52
Member 20300389-Jul-05 8:52 
GeneralRe: Removing selected text from a string Pin
User 66589-Jul-05 9:09
User 66589-Jul-05 9:09 
GeneralRe: Removing selected text from a string Pin
Member 20300389-Jul-05 9:25
Member 20300389-Jul-05 9:25 
Questioncreating installer, startup??? Pin
marazm19-Jul-05 6:58
marazm19-Jul-05 6:58 
AnswerRe: creating installer, startup??? Pin
marazm19-Jul-05 7:48
marazm19-Jul-05 7:48 
AnswerRe: creating installer, startup??? Pin
amitmohanty9-Jul-05 15:16
amitmohanty9-Jul-05 15:16 
AnswerHERE IS THE ANSWER Pin
marazm19-Jul-05 16:20
marazm19-Jul-05 16:20 
GeneralRe: HERE IS THE ANSWER Pin
amitmohanty9-Jul-05 18:17
amitmohanty9-Jul-05 18:17 
GeneralIn first time I draw, in the second, no. Pin
Alex Cutovoi9-Jul-05 6:21
Alex Cutovoi9-Jul-05 6:21 
GeneralRe: In first time I draw, in the second, no. Pin
Snowblind379-Jul-05 10:23
Snowblind379-Jul-05 10:23 
GeneralRe: In first time I draw, in the second, no. Pin
Alex Cutovoi10-Jul-05 5:21
Alex Cutovoi10-Jul-05 5:21 
GeneralNeed help using an abstract WebMethod Pin
Snowblind379-Jul-05 5:32
Snowblind379-Jul-05 5:32 
GeneralRe: Need help using an abstract WebMethod Pin
Member 20300389-Jul-05 9:05
Member 20300389-Jul-05 9:05 
GeneralRe: Need help using an abstract WebMethod Pin
Snowblind379-Jul-05 9:44
Snowblind379-Jul-05 9:44 
GeneralRe: Need help using an abstract WebMethod Pin
leppie9-Jul-05 14:30
leppie9-Jul-05 14:30 
GeneralRe: Need help using an abstract WebMethod Pin
Snowblind379-Jul-05 17:47
Snowblind379-Jul-05 17:47 
GeneralRe: Need help using an abstract WebMethod Pin
Snowblind3710-Jul-05 3:34
Snowblind3710-Jul-05 3:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.