locked
Extract only uppercase words in a text file RRS feed

  • Question

  • Hi
    I m having a text file written in notepad. I would like to know how to extract only all words in uppercases without having those in lowercases after the extraction.
    I need the code in VB.net which can solve this issue.
    Thank you
    Wednesday, January 13, 2010 7:30 PM

Answers

  • following is example code which check whether string is upper case or lower....

    Option Compare Binary
    'temp is string we want to check 
    If temp = UCASE(temp) Then 
       'temp is uppercase
    Else
       'temp is lowercase
    End If
    • Marked as answer by baph Saturday, January 16, 2010 9:44 AM
    Wednesday, January 13, 2010 9:13 PM

All replies

  • You can use regular expressions to retrieve such functionality. Why have you posted this question here?

    Truth is opened the prepared mind

    My blog (english)
    Мой блог (русскоязычный)free countersLocations of visitors to this page
    Wednesday, January 13, 2010 7:37 PM
    Moderator
  • following is example code which check whether string is upper case or lower....

    Option Compare Binary
    'temp is string we want to check 
    If temp = UCASE(temp) Then 
       'temp is uppercase
    Else
       'temp is lowercase
    End If
    • Marked as answer by baph Saturday, January 16, 2010 9:44 AM
    Wednesday, January 13, 2010 9:13 PM
  • Thank you MayanKP. Your code has been very helpful for me.
    I m having another problem. I want to read word by word all words include in a sentence. I have tried streamreader.read method but that method read character by charater. Please try to solve this problem for me if possible.
    The fact is that, I have a project whereby they asked me to extract the location, name, death date and birth date of each person from a text file (this text file includes many names which are written in uppercase and the location is the name of the text file. As for the death date and birth date, they are written in the text file too)
    Thank you to consider my request..

    Saturday, January 16, 2010 10:03 AM
  • Use the StreamReader.ReadLine() method to read an entire line and then use String.Split(" ") to divide that line into tokens that you can then process. But I don't see what this has got to do with MS CRM?
    Saturday, January 16, 2010 11:21 AM