1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Output differences between 2 strings

Discussion in 'C#' started by codeunlock, Apr 29, 2007.

  1. codeunlock

    codeunlock New Member

    Joined:
    Apr 18, 2007
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    I'm looking to load an ascii file's contents into a string, and compare it against a string pulled down from a database table. And if the database table string does not match the string in the variable loaded from the file, dump to a long what's missing from the table's string or what's extra in the table string.

    I know I can do a string.compare and get a boolean true/false, but can someone point me in the right direction on the how-to of parsing of text to do what I need?

    Thanks,
     
  2. imported_xpi0t0s

    imported_xpi0t0s New Member

    Joined:
    Jul 18, 2008
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    0
    String parsing is quite a large subject and depends mainly on what the data is and what you want to do with it. Can you give an example of some data and describe what you would like done with it?
     
  3. praspam

    praspam New Member

    Joined:
    Feb 22, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    Use the regex to compare the two string

    System.Text.RegularExpressions.Regex regExTime = new System.Text.RegularExpressions.Regex("\\d{2}_\\d{2} [{A-Z}{A-Z}]", System.Text.RegularExpressions.RegexOptions.IgnoreCase);

    if (regExTime.IsMatch(strFieldValue))

    use this place other condition to match your search.
     

Share This Page