Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 909191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:50:13+00:00 2026-05-15T16:50:13+00:00

I am looking for a way to split PascalCase strings, e.g. MyString, into separate

  • 0

I am looking for a way to split PascalCase strings, e.g. “MyString”, into separate words – “My”, “String”. Another user posed the question for bash, but I want to know how to do it with general regular expressions or at least in .NET.

Bonus if you can find a way to also split (and optionally capitalize) camelCase strings: e.g. “myString” becomes “my” and “String”, with the option to capitalize/lowercase either or both of the strings.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:50:14+00:00Added an answer on May 15, 2026 at 4:50 pm

    See this question: Is there a elegant way to parse a word and add spaces before capital letters? Its accepted answer covers what you want, including numbers and several uppercase letters in a row. While this sample has words starting in uppercase, it it equally valid when the first word is in lowercase.

    string[] tests = {
       "AutomaticTrackingSystem",
       "XMLEditor",
       "AnXMLAndXSLT2.0Tool",
    };
    
    
    Regex r = new Regex(
        @"(?<=[A-Z])(?=[A-Z][a-z])|(?<=[^A-Z])(?=[A-Z])|(?<=[A-Za-z])(?=[^A-Za-z])"
      );
    
    foreach (string s in tests)
      r.Replace(s, " ");
    

    The above will output:

    [Automatic][Tracking][System]
    [XML][Editor]
    [An][XML][And][XSLT][2.0][Tool]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a way to split a Twitter permalink string on its final
I'm looking for a way, in .NET, to split a string while ignoring split
What I'm looking to do is split data from string into an array. Here's
I'm looking for a way to split a string containing HTML in to two
I'm looking for a way to split a URL into its component parts so
Possible Duplicate: Split List into Sublists with LINQ I'm looking for some way to
I'm looking for a way how to split job execution in talend studio according
I'm looking a way to build conditional assignments in bash: In Java it looks
I'm looking for a way to do this ... SELECT FirstName, LastName, Split(AddressBlock, '
I'm looking for a way to pull the last characters from a String, regardless

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.