Click here to Skip to main content
15,902,112 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionGetting the outermost Document object in webbrowser control Pin
Ahmad Zaidi2-Sep-07 4:10
Ahmad Zaidi2-Sep-07 4:10 
QuestionDatagridView row selection Pin
Mr Oizo2-Sep-07 3:13
Mr Oizo2-Sep-07 3:13 
AnswerRe: DatagridView row selection Pin
Widgets2-Sep-07 14:52
Widgets2-Sep-07 14:52 
Questionplease help me with combobox keycode Pin
bapu28892-Sep-07 2:16
bapu28892-Sep-07 2:16 
AnswerRe: please help me with combobox keycode Pin
Lucky Sheikh6-Sep-07 20:40
Lucky Sheikh6-Sep-07 20:40 
QuestionReplace multiple space with Single space in RichTextBox Pin
Rupesh Kumar Swami2-Sep-07 2:11
Rupesh Kumar Swami2-Sep-07 2:11 
AnswerReplace multiple space with Single space in RichTextBox Pin
Chatura Dilan2-Sep-07 3:24
Chatura Dilan2-Sep-07 3:24 
AnswerRe: Replace multiple space with Single space in RichTextBox Pin
Luc Pattyn2-Sep-07 4:04
sitebuilderLuc Pattyn2-Sep-07 4:04 
Hi,

remark: I will use - to indicate a space

1. in a string s the statement s=s.Replace("--","-") would replace every pair
of spaces by a single space; so 7 spaces would become 4 spaces.

2. if you redo step 1 the number of spaces would be further reduced; you could loop over 1.
until the length of s no longer changes.

3. you can apply the above to myRichTextBox.Rtf

With the above, you would have fewer than 10 lines of code to remove all multiple spaces.

BTW: if you want to leave double spaces as is, replace step 1 by s=s.Replace("---","--")

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]


this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google


Questioncombobox questions Pin
xebe2-Sep-07 0:11
xebe2-Sep-07 0:11 
AnswerRe: combobox questions Pin
Rupesh Kumar Swami2-Sep-07 0:45
Rupesh Kumar Swami2-Sep-07 0:45 
GeneralRe: combobox questions Pin
xebe2-Sep-07 4:02
xebe2-Sep-07 4:02 
GeneralRe: combobox questions Pin
Rupesh Kumar Swami2-Sep-07 19:19
Rupesh Kumar Swami2-Sep-07 19:19 
AnswerRe: combobox questions Pin
Widgets2-Sep-07 14:58
Widgets2-Sep-07 14:58 
AnswerRe: combobox questions Pin
arjunjagtap2-Sep-07 19:39
arjunjagtap2-Sep-07 19:39 
Questioncombobox problem Pin
SamRST1-Sep-07 22:49
SamRST1-Sep-07 22:49 
AnswerRe: combobox problem Pin
Vasudevan Deepak Kumar1-Sep-07 23:09
Vasudevan Deepak Kumar1-Sep-07 23:09 
Questionpls help! Pin
Rharzkie1-Sep-07 20:51
Rharzkie1-Sep-07 20:51 
GeneralRe: pls help! Pin
Guffa1-Sep-07 22:04
Guffa1-Sep-07 22:04 
Questionxml & Vb.net Pin
MrScruff6661-Sep-07 13:03
MrScruff6661-Sep-07 13:03 
AnswerRe: xml & Vb.net Pin
Christian Graus1-Sep-07 13:20
protectorChristian Graus1-Sep-07 13:20 
QuestionConnection string for an access database Pin
Mr Oizo1-Sep-07 8:46
Mr Oizo1-Sep-07 8:46 
AnswerRe: Connection string for an access database Pin
jensenx1-Sep-07 20:08
jensenx1-Sep-07 20:08 
AnswerRe: Connection string for an access database Pin
Vasudevan Deepak Kumar1-Sep-07 23:08
Vasudevan Deepak Kumar1-Sep-07 23:08 
GeneralRe: Connection string for an access database Pin
Mr Oizo2-Sep-07 0:01
Mr Oizo2-Sep-07 0:01 
Questionplz help me in login form in vb.net Pin
asifullahkhan1-Sep-07 7:52
asifullahkhan1-Sep-07 7:52 

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.