![]() |
|
[.NET] Split Strings To Text boxes - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Split Strings To Text boxes (/showthread.php?tid=4656133) |
Split Strings To Text boxes - NigerianKing - Jan 26, 2015 Hello, So button "browse" will pick the txt files with "email:pass" lines. Then button "Input" will input the "email:pass" data but it will split the string so email goes to first textbox (email). Pass for second textbox (pass). Etc.
* - Only3 - Jan 26, 2015 textboxemail = textbox.split(":")(0) textboxpass = textbox.split(":")(1) * - NigerianKing - Jan 26, 2015 (Jan 26, 2015 01:36 PM)Only3 Wrote: textboxemail = textbox.split(":")(0) Is that in? Won't it be for each account in listbox1.items? EDIT: I get errors. * - Xghost7 - Jan 26, 2015 ![]() Quite easy, i hope you can go further with this mate. (0) is the value before the split in this case is (:) (1) is the value after the split in this case is (:) Regards. * - NigerianKing - Jan 26, 2015 (Jan 26, 2015 01:37 PM)Xghost7 Wrote: Thanks bro, that's what i needed mate. Thanks for the example! How would i use a listbox instead = listbox.items? * - Hawk HF - Jan 26, 2015 (Jan 26, 2015 01:38 PM)NigerianKing Wrote: Thanks bro, that's what i needed mate. Thanks for the example! How would i use a listbox instead = listbox.items? The code you're asking for is quite simple. The snippet below will take a listbox full of combos and split them into two separate listboxes.
* - Odus - Jan 26, 2015 (Jan 26, 2015 02:05 PM)Hawk HF Wrote: At least someone has sense. There's no point splitting twice. * - Only3 - Jan 26, 2015 (Jan 26, 2015 03:05 PM)Odus Wrote: At least someone has sense. There's no point splitting twice. if its just one then theres no point to declare * - Hawk HF - Jan 26, 2015 (Jan 26, 2015 03:30 PM)Only3 Wrote: if its just one then theres no point to declare You're probably right. It would be a minimal difference if there was one. When coding it, it just seemed easier to understand. It also allows more room for functionality, such as checking to make sure that there are only two strings in the collection. |