Skip to sidebar Skip to content
Ipercube Technical
Jack of all trades, master of none
Date: Time: - Stardate:
Welcome, Log in by clicking  Here!
SS64
MDN
Stack
Code
GitHub
Wiki
Convert
V Studio
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions
Ipercube Technical
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions

Text Analysis – Get Words Starting With Uppercase

Extracts and returns a list of words from a string that start with an uppercase letter.

The function scans the input character by character and starts a new word every time it encounters an uppercase letter. It accumulates characters until the next uppercase letter is found, at which point it finalizes the previous word.

VB
    Public Function GetWordsStartingWithUppercase(ByVal input As String) As List(Of String)
    
        If String.IsNullOrEmpty(input) Then
            Return New List(Of String)()
        End If

        Dim result As New List(Of String)
        Dim currentWord As String = String.Empty

        ' loop on chars
        For Each c As Char In input
            If Char.IsUpper(c) Then
                ' New word start
                If currentWord <> String.Empty Then
                    result.Add(currentWord.Trim())
                End If
                currentWord = c
            Else
                currentWord &= c
            End If
        Next

        ' Add last word if any
        If currentWord <> String.Empty Then
            result.Add(currentWord.Trim())
        End If

        Return result
    End Function

Posted by ipercube


© 2026 Ipercube Design