Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2005
    Posts
    5

    String manipluation in listbox?

    I have few items in my listbox like:
    monday1.something.txt
    saturday2.something.txt
    sunday4.something.txt
    ......

    My question for all good people here is:
    How can I get new string from each item in the listbox that contain characters until "."(dot). for example, I need this:
    newstring1 = monday1,
    newstring2 = saturday2,
    newstring = sunday4 ...

    and so on.

    Thanks, Rado

  2. #2
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    Give this a shot....

    Code:
    -- get the total number of items in you listbox
    nCountdown = ListBox.GetCount("YourListBoxName");
    
    -- start at the last item and loop your way up changing the text as we go
    while nCountdown > 0 do
    
         -- get the current text for this item
         strItemText = ListBox.GetItemText("YourListBoxName", nCountdown);
    
         -- cut the junk from the end of the string
         strItemText = String.TrimRight(strItemText, ".something.txt");
    
         -- set the item to the new text
         ListBox.SetItemText("YourListBoxName", nCountdown, strItemText);
    
         -- set the counter to the next item
         nCountdown = nCountdown -1
    
    end
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  3. #3
    Join Date
    May 2005
    Posts
    5
    Thank you very much. Let me try.

  4. #4
    Join Date
    May 2005
    Posts
    5
    It works. Thank you so much.
    Rado

Similar Threads

  1. Add to listbox from search string
    By nirus in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 02-15-2005, 08:54 AM
  2. attempt to index a string value
    By csd214 in forum AutoPlay Media Studio 5.0
    Replies: 8
    Last Post: 08-08-2004, 01:23 AM
  3. Example: Using the ListBox object
    By Ted Sullivan in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 05-07-2004, 12:24 PM
  4. Listbox... how to? part 2
    By cold_fusion in forum AutoPlay Media Studio 4.0
    Replies: 7
    Last Post: 02-07-2004, 12:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts