This is a migrated thread and some comments may be shown as answers.

Splitting string of a textbox

1 Answer 398 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
obi
Top achievements
Rank 1
obi asked on 25 Jan 2020, 02:05 AM
I have 80 email addresses separated with comma in a textbox. I also have four empty textboxes. How can I share the 80 email addresses equally among the four textboxes? I have not tried any thing because I no idea on how to start.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 27 Jan 2020, 11:52 AM

Hello, Obi,  

There is no automatic way for splitting the text with emails in different groups and assigning them to different RadTextBox controls. 

However, you can split the long string by the specific separator and you can count how many emails you have in the array in order to determine what part of the array is 1/4 of the whole text. Then, a subset of the obtained array of text values can be concatenated by the String.Join method and thus assign different part of the array to the different text box controls:
https://docs.microsoft.com/en-us/dotnet/api/system.string.split?view=netframework-4.8 
https://docs.microsoft.com/en-us/dotnet/api/system.string.join?view=netframework-4.8 

I would suggest you to use a RadAutoCompleteBox which would be suitable for displaying emails. Each tokenized text block is separated by character, specified by the Delimiter property. You can change the Delimiter at any time. Please refer to the following help articles which will get you familiar with the RadAutoCompleteBox control and how it displays the tokenized strings:
https://docs.telerik.com/devtools/winforms/controls/editors/autocompletebox/autocompletebox 
https://docs.telerik.com/devtools/winforms/controls/editors/autocompletebox/getting-started 

I hope this information helps. If you need any further assistance please don't hesitate to contact me.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
TextBox
Asked by
obi
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or