Code (Visual Basic): <div class="vb" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">Public</span> <span style="color: #b1b100;">Function</span> remove_spaces<span style="color: #66cc66;">(</span>list <span style="color: #b1b100;">As</span> ListBox<span style="color: #66cc66;">)</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">Dim</span> z <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Long</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">Dim</span> bolexit <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Boolean</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">bolexit = Â <span style="color: #b1b100;">false</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">z = <span style="color: #cc66cc;">0</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â </li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">bolexit = <span style="color: #b1b100;">False</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">Do</span> Until z > list.<span style="color: #66cc66;">ListCount</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â <span style="color: #b1b100;">Do</span> Until bolexit = <span style="color: #b1b100;">True</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â <span style="color: #b1b100;">If</span> <span style="color: #b1b100;">Right</span><span style="color: #66cc66;">(</span>list.<span style="color: #66cc66;">list</span><span style="color: #66cc66;">(</span>z<span style="color: #66cc66;">)</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">)</span> = <span style="color: #ff0000;">" "</span> <span style="color: #b1b100;">Then</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â list.<span style="color: #66cc66;">list</span><span style="color: #66cc66;">(</span>z<span style="color: #66cc66;">)</span> = <span style="color: #b1b100;">Left</span><span style="color: #66cc66;">(</span>list.<span style="color: #66cc66;">list</span><span style="color: #66cc66;">(</span>z<span style="color: #66cc66;">)</span>, <span style="color: #b1b100;">Len</span><span style="color: #66cc66;">(</span>list.<span style="color: #66cc66;">list</span><span style="color: #66cc66;">(</span>z<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> - <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">)</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â <span style="color: #b1b100;">Else</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â Â Â bolexit = <span style="color: #b1b100;">True</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â Â Â <span style="color: #b1b100;">Loop</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Â Â z = z + <span style="color: #cc66cc;">1</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">Loop</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Function</span></li></ol></div> This code will remove the spaces at the end of the listbox you can change it to get it from the begging also
Re: Remove Spaces from the end of your ab items [vb6] You can do this, or you can also open up the txt and Replace all " " with ""
Re: Remove Spaces from the end of your ab items [vb6] nope, that will turn Bony Grarrl Club into BonyGrarrlClub and this does it in the listbox, not the file.
Is there a code you can make that would add a capitial to the the first letter and to the first letter thats right beside a space? So say if it was rainbow plushie you could make it into Rainbow Plushie
sorry, but this is bothering me, would this be considered gravedigging if its helpful? o.o visual basic has a function to erase leading spaces for you. the Trim(string) function Code (Text): <div class="text" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> Public Function remove_spaces(list As ListBox)</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> Dim z As integer</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> For z=0 to list.listcount-1</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> list.list(z) = trim(list.list(z))</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> Next z</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> End Function</li></ol></div> Along with putting in the trim function, i made it much simpler and quicker. sorry for bursting your bubble, or gravedigging
Re: Yes it is done using the StrConv function. Example: Code (Text): Public Sub ProperCase (ByVal List1 As ListBox) Dim x As Integer For x = 0 to List1.ListCount - 1 List1.List(x) = strConv(List1.List(x), vbProperCase) Next x End Sub (Sorry for possible "gravedig", but I want to contribute) -Zach