<bdo id='aeiSw'></bdo><ul id='aeiSw'></ul>
<i id='aeiSw'><tr id='aeiSw'><dt id='aeiSw'><q id='aeiSw'><span id='aeiSw'><b id='aeiSw'><form id='aeiSw'><ins id='aeiSw'></ins><ul id='aeiSw'></ul><sub id='aeiSw'></sub></form><legend id='aeiSw'></legend><bdo id='aeiSw'><pre id='aeiSw'><center id='aeiSw'></center></pre></bdo></b><th id='aeiSw'></th></span></q></dt></tr></i><div id='aeiSw'><tfoot id='aeiSw'></tfoot><dl id='aeiSw'><fieldset id='aeiSw'></fieldset></dl></div>

      <small id='aeiSw'></small><noframes id='aeiSw'>

        <legend id='aeiSw'><style id='aeiSw'><dir id='aeiSw'><q id='aeiSw'></q></dir></style></legend><tfoot id='aeiSw'></tfoot>
      1. 如何将字符串拆分为多个值?

        How do i split a String into multiple values?(如何将字符串拆分为多个值?)

        <i id='NhHT3'><tr id='NhHT3'><dt id='NhHT3'><q id='NhHT3'><span id='NhHT3'><b id='NhHT3'><form id='NhHT3'><ins id='NhHT3'></ins><ul id='NhHT3'></ul><sub id='NhHT3'></sub></form><legend id='NhHT3'></legend><bdo id='NhHT3'><pre id='NhHT3'><center id='NhHT3'></center></pre></bdo></b><th id='NhHT3'></th></span></q></dt></tr></i><div id='NhHT3'><tfoot id='NhHT3'></tfoot><dl id='NhHT3'><fieldset id='NhHT3'></fieldset></dl></div>
          <bdo id='NhHT3'></bdo><ul id='NhHT3'></ul>
          <tfoot id='NhHT3'></tfoot>

            <tbody id='NhHT3'></tbody>
            • <legend id='NhHT3'><style id='NhHT3'><dir id='NhHT3'><q id='NhHT3'></q></dir></style></legend>

                • <small id='NhHT3'></small><noframes id='NhHT3'>

                  本文介绍了如何将字符串拆分为多个值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何拆分字符串?

                  假设我有一个字符串狗、猫、老鼠、鸟"

                  Lets say i have a string "dog, cat, mouse,bird"

                  我的实际目标是将这些动物中的每一个都插入到一个列表框中,这样它们就会成为列表框中的项目.

                  My actual goal is to insert each of those animals into a listBox, so they would become items in a list box.

                  但如果我知道如何拆分字符串,我想我知道如何插入这些项目.或者有人知道更好的方法吗?

                  but i think i get the idea on how to insert those items if i know how to split the string. or does anyone know a better way to do this?

                  我使用asp c#

                  推荐答案

                      string[] tokens = text.Split(',');
                  
                      for (int i = 0; i < tokens.Length; i++)
                      {
                            yourListBox.Add(new ListItem(token[i], token[i]));
                      }
                  

                  这篇关于如何将字符串拆分为多个值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Populate ListBox with a IEnumrable on another thread (winforms)(在另一个线程(winforms)上使用 IEnumrable 填充 ListBox)
                  listbox selected item give me quot; System.Data.DataRowViewquot; , C# winforms(列表框选择的项目给我quot;System.Data.DataRowView, C# Winforms)
                  Cannot remove items from ListBox(无法从列表框中删除项目)
                  Preventing ListBox scrolling to top when updated(更新时防止列表框滚动到顶部)
                  Drag and drop from list to canvas on windows phone with MVVM(使用 MVVM 在 Windows 手机上从列表拖放到画布)
                  Deselection on a WPF listbox with extended selection mode(具有扩展选择模式的 WPF 列表框上的取消选择)
                    <tbody id='fgiE3'></tbody>
                  <i id='fgiE3'><tr id='fgiE3'><dt id='fgiE3'><q id='fgiE3'><span id='fgiE3'><b id='fgiE3'><form id='fgiE3'><ins id='fgiE3'></ins><ul id='fgiE3'></ul><sub id='fgiE3'></sub></form><legend id='fgiE3'></legend><bdo id='fgiE3'><pre id='fgiE3'><center id='fgiE3'></center></pre></bdo></b><th id='fgiE3'></th></span></q></dt></tr></i><div id='fgiE3'><tfoot id='fgiE3'></tfoot><dl id='fgiE3'><fieldset id='fgiE3'></fieldset></dl></div>

                    <small id='fgiE3'></small><noframes id='fgiE3'>

                      • <bdo id='fgiE3'></bdo><ul id='fgiE3'></ul>

                        <tfoot id='fgiE3'></tfoot>
                        <legend id='fgiE3'><style id='fgiE3'><dir id='fgiE3'><q id='fgiE3'></q></dir></style></legend>