---
title: "How to capitalize every third letter of a string in C#?"  
description: "How to capitalize every third letter of a string in C#?"  
author: "Jayden Bell"  
published: 2014-03-06  
updated: 2014-03-06  
canonical: https://www.mindstick.com/forum/1977/how-to-capitalize-every-third-letter-of-a-string-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How to capitalize every third letter of a string in C#?

Does anybody know how to capitalize every [third](https://yourviews.mindstick.com/story/4957/the-significance-of-the-third-eye-in-hinduism-more-than-just-a-symbol) letter of a [string](https://www.mindstick.com/articles/1527/string-split-in-c-sharp) in C# ? I loop through the whole string with a [for loop](https://www.mindstick.com/forum/12568/android-for-loop-not-working-in-main-thread), but I can't think of the [sequence](https://www.mindstick.com/interview/34504/difference-between-identity-vs-sequence) [right now](https://answers.mindstick.com/qa/36863/what-would-happen-if-gravity-became-5-percent-stronger-right-now).

Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)

## Replies

### Reply by Pravesh Singh

Hi Jayden,\

I suspect you just want something like this:

// String is immutable; copy to a char[] so we can modify that in-place

char[] chars = input.ToCharArray();

for (int i = 0; i < chars.Length; i += 3)

{

chars[i] = char.ToUpper(chars[i]);

}

// Now construct a new String from the modified character array

string output = new string(chars);

That assumes you want to start capitalizing from the first letter, so "abcdefghij" would become "AbcDefGhiJ". If you want to start capitalizing elsewhere, just change the initial value of i.


---

Original Source: https://www.mindstick.com/forum/1977/how-to-capitalize-every-third-letter-of-a-string-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
