.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Capital letter in every sentence.

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :ASP.Net


I am using the following code to capitilize the first letter theres written

public String ToUpperFirst(string value)
        if (string.IsNullOrEmpty(value))
            return string.Empty;

        char[] letters = value.ToCharArray();   // convert to char array of the string
        letters[0] = char.ToUpper(letters[0]);  // upper case the first char

        return new string(letters); // return the array made of the new char array

I would like it to capatilize every letter after a .(dot) aswell.

any suggestions on how to do that?

Best regards

View Complete Post

More Related Resource Links

SSRS option to make capital first letter and rest small letters of a string

Hi, In the 'Name' field of String type is appearing all capital letters. I want to appear it as first letter is capital and rest all small. If there is space between two characters, then the second should appear as Caps again. Ex: 1. PETER Should appear like Peter 2. ALEXANDAR PETER Should appear as Alexander Peter Is it possible in SSRS or SQL Query ? I am using SQL Server 2005 SSRS Reporting Services. Thanks,

I need a regex for the following sentence

I have a line of text which is as follows  : This should occur before variable1 = 1 variable2 =2 variable3=6 variable4=9   I want a regex which checks if this text (This should occur before ) comes before  the string of the variables (variable1, variable2, variable3, variable4 ) and also  should pass if the placement of the variables can occur anywhere in the sentence.Also the regex should pass only if the variable4 has a value greater than 9.  

How to extract subjects and objects from a sentence

Hi all I am supposed to do these few things in my program but I got stuck.  Step 1: To split and count the number of words in the sentence input by users. Step 2: To extract subjects and objects e.g. nsubj, pobj, etc from the sentence input by users. Or to remove the bad words (stop words) from the sentence with the database of the stop words. Step 3: To check words that match the clues and patterns. E.g. Jones was born in 1975; the matching words are Jones, born, 1975. The clues and patterns are all in sql database. Step 4: To check proper noun - capital word for each starting word) Here are my half-way done codes. I hope there are someone can help on advising me on how to continue it. Imports System Imports System.IO Imports System.Text Imports System.Text.RegularExpressions Module Module1 'To count the words Public Function getWordCount(ByVal InputString As String) As Integer Return Split(System.Text.RegularExpressions.Regex.Replace(InputString, "\s+", Space(1))).Length End Function 'To eliminate stop words and replace with a space Public Function StripStopWords(ByVal s As String) As String Dim StopWords As String = ReadFile("C:\Users\jaimiechin\Desktop\stopwords.txt").Trim Dim StopWordsRegex As String = Regex.Replace(StopWords, "\s+", "|") ' about|after|all|also etc.

Changing case of all URLs in the website source code from Sentence to Lower

I only want to change case (Mixed to small) of URL in HREF attribute, nowhere else. This is just for convention purpose. eg changing   Its <a href="http://www.abc.com/S pecial-E dition.aspx">Special Ediation</a>.  View <a href="http://www.abc.com/O ther-N ews.aspx">Other News</a>.   to   Its <a href="http://www.abc.com/s pecial-e dition.aspx">Special Ediation</a>.  View <a href="http://www.abc.com/o ther-n ews.aspx">Other News</a>.

Simple Regex. Select 2 strings in a sentence

Hello,  I am a begginer in Regular expressions. I am trying to write a regex to print out a specific string in a sentence.  For example:  "We've found questions similar to yours" I would like to create a regex for the word "found" and "yours". whenever found is matched OR yours is matched print the word.  Basically i just need to know how the OR statement works in this case.  regex.match("found" OR "yours")  ??? Thank you -Klevis

How to remove a letter word from a desired date format

Hi, I have a requirement where I need to format the date in “YYYYMMDDHHMMSS” format and generate XML file. Since there is a space in the table in betweenDay and Hours so that a letter T appears in the actual XML file when the XML is getting generated as : Value in the table as : 2010-09-07X 00:00:00.000 - A blank space is there in the X place .. Value of the XML O/p as   <AccountingValueDate>2010-09-03T13:31:20.803</AccountingValueDate> --Where we can see a T appears which I want to remove The query is below: Select  AD.deliveryDate FROM Product.Account AD I have tried something like below but it is not working: Select  CONVERT(VARCHAR(19),AD.deliveryDate , 120)  FROM Product.Account AD but it's not giving me the desired O/P My actual requirement is I just want to remove the T from my XML output and format the date as  YYYYMMDDHHMMSS Please somebody suggest me how to do this asap... I am using SQL Server 2008 version. Thanks a lot -pep      

SQLExpress 2008 R2 64bit using NewName results in logical filename losing last letter in Backup


We have a problem that is only occurring on the 64 bit edition of SQL 2008 R2 (the 32 bit R2, and 64 bit original are fine). 

As part of our install we restore a database called TaxMasterFresh’ and rename it to ‘TaxMaster’. We have a step to rename the logical files of the database to complete the operation:



Create a letter with addresses with MSSQL connection



We need to send out about 10.000 letters each month. They will be sent via postal services so I have to print them out with a new label/address on each letter. The envelope does have a window so the letter will be printed with the address.

All addresses will be found in a MSSQL database. I know how to make a SQL connection. I really need some input on how I would start doing this. The letter will be a twosided letter with the address in the upper right corner. How can I make a connection so that it loops trough the database for address and adds one by one. It should also add a new letter/page for each address found in the database.

Does anyone have a clue where to start or have any good ideas on how to accomplish a such thing?

Best regards Daniel

Font/letter spacing issue when printing from SSRS 2008 report page


We are developing reports in SSRS 2008.  When printing from the SSRS report page, we are seeing that that some text is "clumping" together or spaced oddly. I have tried a variety of printers so it's not printer-specific. If you export from the SSRS page to PDF or to Word and then print, everything prints as expected.

Nothing is as good as real text/names/data, but to reproduce, simply create several text boxes with...

I used several common fonts...
Arial, 10 pt (SSRS 2008 default)
Times New Roman, 12 pt (Office 2003 default)
Calibri, 11 pt (Office 2007 default)
Verdana, 11 pt
Tahoma, 11 pt

In the example above, I used normal weight, nothing fancy... If you use bold and underline, which is common for a page/column header or footer, this issue is even more apparent.

It feels similar to the following issue: https://connect.microsoft.com/SQLServer/feedback/details/482312/ssrs-report-font-rendering-issue

A workaround would obviously be to export to PDF and then print, but these are steps that our end users shouldn't have to (and won't want to) put up with to produce reports/invoices/etc. that ultimately go

Regex: password must contain one number, one letter, and 0 or more special chars


I'm trying to validate a password, and I'm almost there, but need some help finishing it off. Here's what I need:

1) 6-10 characters

2) At least one alpha AND one number

3) The following special chars are allowed (0 or more): !@#$%

Here's what I have:


Passwords that should work: test1ng, abc123, abc1234567, 123abc, abc!123, !@#$%1abcd, !@#$%a9

Passwords that shouldn't work: a, 1, a1, 1$, %, abc!@#, 012345, a1234+, abcde, test*ng, abcde!, !@#$%!, a1234567890, testit!0987, 1abcdefghij

It works on all my test cases, except it allows "a1234567890", "testit!0987", and "1abcdefghij", none of which should be allowed, since they contain more than 10 chars. What am I missing?

Does Regular Expression (RegEx) able to extract Sentence from paragraphs



I am new to Regular languages; I have been trying to find out whether Regex is able to extract sentences from any paragraph (text) on PDF format based on particular words (pattern).



Can you please outlines this with example in C#


Thank you in advance  

How Regular Expression extract Sentence from paragraphs



Hello there

I hope that you can provide me with code exmaple of extracting sentence from paragraph,I have insert paragraph below as exmaple,However, you can outline this for me in differnet example if wish too,Thank you in advance 

paragraph example

The goals of the information extraction system is to understand and transfer different structure of natual lanaguge  text and structuring the extracted units of the information into understandable formation in such data structure. The information extraction is enable is to produce semantic representation of the text, the extracted semantic units of information is could be utilized for information analysis.The information extraction system is unable to understating the actual text, but its attempts finds and extract pieces of information that is relevant to predefined pattern .Machine learning is tools to analysis these and produces from them facts.


In Textbox, type in one letter and show words starting with that letter


Hi everyone,

I think this is a little tricky problem, but I need to solve it somehow. 

I have a texbox in my asp.net page.

I want to show all names when a user types in a letter in that textbox, whatever names starting with that letter.

the names are from a list generated by other function, pulled out from active directory.

So for example:

User types in "a" in a textbox then automactically names "aron" "asron" "amanda" in the list shows, and user can select one of those names.

How can I do this?

Thank you for advance :)


Decimal parsing with letter B

I' m working on receiving quotes from Yahoo quotes provider. Its results for market capitalization of a company usualy include letter B as meaning of a billion. But when I try to use usual decimal.Parse I get an exception. I've looked to the documentation but all the parameters of Parse function have no option to specify that the letter B means billion. Tell me please if some class of .Net Framework provides a tool to parse a decimal with such specifying of millions, billions, etc. with letters.

How to find records based on CAPITAL and small letters in SQL Query?



I stumbled upon this scenario at my work and it is really something I was not expecting. I know that in general SQL itself is not a CASE SENSITIVE language ... so it will not make any difference if i write select *, or SELECT * or SeLEct * ...

But recently I came across a situation where I am required to find results from a table where more than one record exists with just a difference of Captial and Small letter word. Let me explain my problem in detail,

I work for a government client, in one of their table they have list of all state statues and out of them some have exactly same string except in that string some letters are capitalized, e.g.  46b-12 (A) and 46b-12 (a) ... now my question is how can i write a query which can find only record that I search, e.g if I search select desc from statues where code='46b-12 (a)' ... it should find only one record not two.

news letter subscription form


Dear All,

I need to create a subscription-form script. So when customer pastes this script into their website. the data (basically a name and email text boxes and a submit button) will be saved into a database table. (This is similar to the script generated by the email marketing companies)

What should i do

Pls help

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend