Click here to Skip to main content
15,888,461 members
Home / Discussions / C#
   

C#

 
GeneralRe: recursive function to print data in the console in the output of a tree structure in c# Pin
Ravi Bhavnani6-Oct-15 5:13
professionalRavi Bhavnani6-Oct-15 5:13 
GeneralRe: recursive function to print data in the console in the output of a tree structure in c# Pin
OriginalGriff5-Oct-15 4:44
mveOriginalGriff5-Oct-15 4:44 
GeneralRe: recursive function to print data in the console in the output of a tree structure in c# Pin
CHill605-Oct-15 5:58
mveCHill605-Oct-15 5:58 
AnswerRe: recursive function to print data in the console in the output of a tree structure in c# Pin
Gerry Schmitz5-Oct-15 10:52
mveGerry Schmitz5-Oct-15 10:52 
Questionclick serche button webbrouwser c# Pin
altar6664-Oct-15 10:19
altar6664-Oct-15 10:19 
AnswerRe: click serche button webbrouwser c# Pin
F-ES Sitecore4-Oct-15 22:39
professionalF-ES Sitecore4-Oct-15 22:39 
Questionusing toupper to uppercase an array index Pin
doughyi8u4-Oct-15 6:32
doughyi8u4-Oct-15 6:32 
AnswerRe: using toupper to uppercase an array index Pin
OriginalGriff4-Oct-15 6:39
mveOriginalGriff4-Oct-15 6:39 
Here's the method I use:
C#
/// <summary>
/// Convert the clipboard text to proper English capitalisation.
/// If Control is down, use Title Case
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void butLowerCase_Click(object sender, EventArgs e)
    {
    bool sentenceCase = (ModifierKeys & Keys.Control) != Keys.Control;
    if (Clipboard.ContainsText())
        {
        string s = Clipboard.GetText();
        string[] lines = s.Split('\n');
        StringBuilder sb = new StringBuilder();
        string EOL = "";
        for (int i = 0; i < lines.Length; i++)
            {
            sb.Append(EOL);
            if (lines[i].Length > 1)
                {
                if (sentenceCase)
                    {
                    sb.Append(lines[i].Substring(0, 1).ToUpper());
                    sb.Append(lines[i].Substring(1).ToLower());
                    }
                else
                    {
                    // Title Case
                    string[] words = lines[i].ToLower().Split(' ');
                    string sep = "";
                    foreach (string word in words)
                        {
                        if (word.Length > 0)
                            {
                            if (conjunctions.Contains(word))
                                {
                                sb.AppendFormat("{0}{1}", sep, word);
                                }
                            else
                                {
                                sb.AppendFormat("{0}{1}{2}", sep, word.Substring(0, 1).ToUpper(), word.Length > 1 ? word.Substring(1).ToLower() : "");
                                }
                            sep = " ";
                            }
                        }
                    }
                }
            else
                {
                sb.Append(lines[i]);
                }
            EOL = "\n";
            }
        Clipboard.SetText(sb.ToString());
        }
    }

Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: using toupper to uppercase an array index Pin
Agent__0074-Oct-15 17:58
professionalAgent__0074-Oct-15 17:58 
AnswerRe: using toupper to uppercase an array index Pin
Gerry Schmitz4-Oct-15 11:32
mveGerry Schmitz4-Oct-15 11:32 
AnswerRe: using toupper to uppercase an array index Pin
PANKAJMAURYA12-Oct-15 20:59
professionalPANKAJMAURYA12-Oct-15 20:59 
QuestionC# find a string in a 2010 Microsoft Word document Pin
Member 120318994-Oct-15 6:08
Member 120318994-Oct-15 6:08 
AnswerRe: C# find a string in a 2010 Microsoft Word document Pin
Ravi Bhavnani4-Oct-15 6:09
professionalRavi Bhavnani4-Oct-15 6:09 
GeneralRe: C# find a string in a 2010 Microsoft Word document Pin
Member 120318994-Oct-15 6:48
Member 120318994-Oct-15 6:48 
GeneralRe: C# find a string in a 2010 Microsoft Word document Pin
Pete O'Hanlon5-Oct-15 4:53
mvePete O'Hanlon5-Oct-15 4:53 
RantProgramming Pin
Member 115145063-Oct-15 14:59
Member 115145063-Oct-15 14:59 
GeneralRe: Programming Pin
BillWoodruff3-Oct-15 16:43
professionalBillWoodruff3-Oct-15 16:43 
GeneralRe: Programming Pin
OriginalGriff3-Oct-15 21:38
mveOriginalGriff3-Oct-15 21:38 
GeneralRe: Programming Pin
Gerry Schmitz4-Oct-15 12:17
mveGerry Schmitz4-Oct-15 12:17 
GeneralRe: Programming Pin
BillWoodruff4-Oct-15 18:33
professionalBillWoodruff4-Oct-15 18:33 
GeneralRe: Programming Pin
JBargisen8-Oct-15 22:10
JBargisen8-Oct-15 22:10 
QuestionShell Sort Algorithm question Pin
Member 117609771-Oct-15 15:19
Member 117609771-Oct-15 15:19 
AnswerRe: Shell Sort Algorithm question Pin
BillWoodruff1-Oct-15 20:24
professionalBillWoodruff1-Oct-15 20:24 
AnswerRe: Shell Sort Algorithm question Pin
Richard Deeming2-Oct-15 1:40
mveRichard Deeming2-Oct-15 1:40 
QuestionMessage Removed Pin
1-Oct-15 2:45
Member 103698471-Oct-15 2:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.