---
title: "How Do I Split A String By Capital Letter in VB.NET?"  
description: "How Do I Split A String By Capital Letter in VB.NET?"  
author: "Anonymous User"  
published: 2014-12-26  
updated: 2014-12-26  
canonical: https://www.mindstick.com/forum/12818/how-do-i-split-a-string-by-capital-letter-in-vb-dot-net  
category: ".net"  
tags: ["vb.net", "string"]  
reading_time: 2 minutes  

---

# How Do I Split A String By Capital Letter in VB.NET?

Im working on [web services](https://www.mindstick.com/articles/942/basics-of-asp-dot-net-web-services) made in VB.NET Im [merging](https://www.mindstick.com/articles/446/copying-merging-and-or-uniting-records-in-sql-server) [datasets](https://www.mindstick.com/articles/13138/tableau-training-the-soul-of-datasets) and datatables from [multiple](https://www.mindstick.com/blog/12797/iowa-is-expected-to-see-heavy-growth-in-multiple-sectors) web services into 1 dataset. Im changing the format of some of the data, for example my [web service](https://www.mindstick.com/articles/895/web-service-introduction) lists the days of the week as a boolean but other web services are using a string like MoTuWedTh... Im on a [webservice](https://www.mindstick.com/forum/166/webservice-method) now where they have used MoTuWeTh.... on some and MoTuWedTh... on others. I was splitting the string into a char array and looping through it and using a [if statement](https://www.mindstick.com/forum/12682/jquery-toggle-if-statement) to say if char(0) & char(1) or char(2) & char(3)... = Mo then Monday column(which is a boolean) = true.\
This was working well until I got to this webservice, if I look for wednesday as We then the days afterthat are not recognised because thursday would become dT, friday would be hF etc.\
My [question](https://www.mindstick.com/blog/23175/how-to-solve-neet-question-paper-in-less-time) is, how can i get the MoTuWed... string to split at each capital letter so it becomes Mo Tu Wed...\
Or can you thing of another way I can do this?

## Replies

### Reply by David Miller

Try this:\
Dim Input As [String] = "MoTuWed"\
Dim Dows As MatchCollection = Regex.Matches(Input, "[A-Z][a-z]+")\
' Dows has Mo, Tu, Wed


---

Original Source: https://www.mindstick.com/forum/12818/how-do-i-split-a-string-by-capital-letter-in-vb-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
