lidds Posted September 28, 2005 Posted September 28, 2005 I have a situation where I need to determine if there are spaces within a textbox and if so produce an error, but I am unsure how to do this in vb.net?? Can anyone help?? Thanks Simon Quote
Machaira Posted September 28, 2005 Posted September 28, 2005 If TextBox1.Text.IndexOf(" ") > -1 Then MessageBox.Show("Space in text") End If Quote Here's what I'm up to.
vbMarkO Posted September 28, 2005 Posted September 28, 2005 Hmm good code, Question can we turn that around now since you have shown how to detect a space.... in my case I need to add a space at a given point of text For example if my text were 1:1 Line of Text 2 Line of text 3 Line of Text 2:1 Line of Text 2 Line of Text 3 Line of Text 4 Line of Text Note I am using an RTB not a TextBox What I would like to do is insert a blank line or better yet a word between verse 3 of chapter 1:1 and 2:1 so that it looks like this 1:1 Line of Text 2 Line of text 3 Line of Text chapterName 2:1 Line of Text 2 Line of Text 3 Line of Text 4 Line of Text How might I go about that? vbMarkO Quote Visual Basic 2008 Express Edition!
Nate Bross Posted September 28, 2005 Posted September 28, 2005 See this thread, http://www.xtremedotnettalk.com/showthread.php?t=94257 I answerd a similar question of yours there. Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.