User Profile

Collapse

Profile Sidebar

Collapse
Sal Sal
Sal Sal
Last Activity: Dec 20 '11, 10:16 PM
Joined: Nov 23 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Answer is located here

    http://social.msdn.microsoft.com/For...1-9ca461a1e252...
    See more | Go to post

    Leave a comment:


  • How do I change the displayed text color of individual list box items?

    Hi I have a listbox that I am adding files to it. If the user checks a specific radiobutton when adding the item, I want to color the text with some color -- but only the text for that item, not all the items. The problem I am having is that my code colors all the items the same. Anyone know a simple way to do this?

    The objects the user is adding to the listbox are files
    and I want to display the Name of the file in the listbox,...
    See more | Go to post

  • I changed my regular expression to this and it worked

    ^XXX.*\r\n(.*\r \n)+(?=^XXX)

    However sometimes when the match contains multiple XXX sections, it matches all the way to the last one and then my match includes multiple sections. I only want it to match one, any suggestions?
    See more | Go to post

    Leave a comment:


  • How to exclude part of a string from a regular expression match?

    If I have a string as follows

    XXXasdf23s5\r\n
    asdflkoirfn329i 4\r\n
    sef29384ewrj280 39\r\n
    XXX123sd3t334\r \n
    sdorfu23984rr\r \n
    sdflk2893rjf\r\ n
    weirj2983jhwer2 398\r\n
    XXX12356789\r\n
    4w3ujr523q938er \r\n

    basically I am searching for sections that begin with XXX but I don't know what the end will be. All I know is that the next section will definitely start with 'XXX'...
    See more | Go to post

  • Interesting, it works now. Thanks very much :)
    See more | Go to post

    Leave a comment:


  • I think I know the problem, although your code works, in this case we are guaranteed that the array will be instantiated with the Split results. So it will never be null.

    In my code the location where I populate each object array is nested inside other code. I have thousands of objects and some of them are null and don't get initialized.

    I'm running another test but does the foreach loop take into account a null...
    See more | Go to post

    Leave a comment:


  • Sorry you can ignore that other code I posted
    Code:
    object.array[0] = "something";
    I mixed up the order in which I was doing this, I populate the array first by assigning the Split result to the array, basically copies the array into my variable. Then later on I do some searching text replacing/modification on the array elements depending on some conditions. (checking if its null first of course)
    ...
    See more | Go to post

    Leave a comment:


  • Yes I'm only using the word object as a name here, its called something else in my program. I don't give my arrays a length at the beginning (i.e. when I instantiate the variable inside the object class) because each object will have a different array size.

    Code:
    [B]private string [] Array = null;[/B]
    
    [B]public string [] array
    {
     get { return this.Array; }
     set { this.Array = value; }
    }[/B]
    ...
    See more | Go to post

    Leave a comment:


  • How to access Array elements in an object that is in a List?

    Hi,

    I have an object, and inside are different variables that I populate during runtime, one of the is an array of string

    Code:
    [B]string [] array = null;[/B]
    So I populate it like this
    Code:
    [B]object.array[0] = "something";[/B]
    Then I have a List of these objects like this and add my objects to it, perform stuff on the list like sorting and search etc.
    Code:
    [B]List<object>[/]
    ...
    See more | Go to post

  • Oralloy thanks, this gives me the same result as my modification in post #3 with the change I made in post #5. Both results are the same negative number (-738)

    From MSDN "the Return Value is: The zero-based index of item in the sorted List<T>, if item is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element, the bitwise...
    See more | Go to post

    Leave a comment:


  • Update:

    I made some progress, I changed from an ArrayList to a List<> because I wanted access to each object in the list, in case i wanted to change a value, and now it works better.

    Code:
    List<reportValues> test2 = new List<reportValues>();
    
    //code to fill List<> and then sort it goes here
    
    values key = new values();
    key.id = "whatever";
    int
    ...
    See more | Go to post

    Leave a comment:


  • I'm not asking for anyone to write my code. I need help because I can't locate the information i need to complete my code.
    Sorry for not including more detail in my first post, i was in a rush :)

    I already sorted my ArrayList, here is the code that does it

    Code:
    //CLASS
        public class sortAscendingHelper : System.Collections.IComparer
        {
            public int Compare(object x, object y)
    ...
    See more | Go to post

    Leave a comment:


  • Sal Sal
    started a topic Help! BinarySearch on an ArrayList of objects

    Help! BinarySearch on an ArrayList of objects

    Hi, I have a sorted (alphanumeric) ArrayList of class objects as follows.

    Code:
        public class reports
        {
            public System.Collections.ArrayList rptCollection = new System.Collections.ArrayList();
            public reports()
            {
               
            }
        }
    
        public class values
        {
            private string ID= string.Empty;
            private
    ...
    See more | Go to post

  • actually I found something that works

    I used Regex.Escape(pa ttern) to treat the * as a regular character. I pass that instead of pattern itself in the replace function.
    See more | Go to post

    Leave a comment:


  • How do I pass * characters in System.Text.RegularExpressions.Regex.Replace

    I am using System.Text.Reg ularExpressions .Regex.Replace( input, pattern, replacement, options) in c# to replace the input string. The pattern I am using may have one or more * or . or any other character basically inside mixed in with the rest of the string. I want to find this string in the input and replace it with something.

    For example say my string is *000000000

    I get the following error
    System.Argument Exception:...
    See more | Go to post
No activity results to display
Show More
Working...