473,657 Members | 2,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

1st cap in each sentence.

I would like to automatically change the first letter to upper case and keep
the rest intact of each sentence on a control of a form, i.e., i am going to
school. see you in the afternoon. -I am going to school. See you in the
afternoon. Is there any functions to do this job?

Thanks,

Scott

Nov 21 '06 #1
8 2485
On Wed, 22 Nov 2006 07:31:41 +0800, Scott wrote:
I would like to automatically change the first letter to upper case and keep
the rest intact of each sentence on a control of a form, i.e., i am going to
school. see you in the afternoon. -I am going to school. See you in the
afternoon. Is there any functions to do this job?

Thanks,

Scott
Only if each record consists of just one sentence.

=UCase(Left([FieldName],1) & LCase(Mid([FieldName],2))

and then it will also change any letter which is supposed to be
capitalized in the middle of the sentence into lower case.

"I saw mary jane visiting the ibm exhibit at the california state
fair."
I don't think that is what you are looking for.

Best to take the same amount of care in writing as you do in some
other activity you have an interest in. <g>
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Nov 21 '06 #2
Scott
Google 'proper case'. Does this answer your question.
tony gardner

Scott wrote:
I would like to automatically change the first letter to upper case and keep
the rest intact of each sentence on a control of a form, i.e., i am going to
school. see you in the afternoon. -I am going to school. See you in the
afternoon. Is there any functions to do this job?

Thanks,

Scott
Nov 22 '06 #3
Scott
Google 'proper case'. Does this answer your question.
tony gardner

Scott wrote:
I would like to automatically change the first letter to upper case and keep
the rest intact of each sentence on a control of a form, i.e., i am going to
school. see you in the afternoon. -I am going to school. See you in the
afternoon. Is there any functions to do this job?

Thanks,

Scott
Nov 22 '06 #4
On 21 Nov 2006 16:51:37 -0800, Tony Gardner wrote:
Scott
Google 'proper case'. Does this answer your question.
tony gardner

Scott wrote:
>I would like to automatically change the first letter to upper case and keep
the rest intact of each sentence on a control of a form, i.e., i am going to
school. see you in the afternoon. -I am going to school. See you in the
afternoon. Is there any functions to do this job?

Thanks,

Scott
Proper case, if I'm not mistaken, capitalizes the first letter of each
word, i.e. "This Is Proper Case."
The poster asked for the first letter of each sentence to be
capitalized, which would indicate that the field contained more than
one sentence.
Even if he searched for the period in each sentence and capitalized
the next letter, it still would not properly work, as many sentences
include periods that are not just at the end of the sentence, i.e.
"Mr. John C. Jones of L. A. Industries."

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Nov 22 '06 #5
Fredg,

Thanks for your reply. I just need to change the first letter of each
sentence and keep other letters untouch.

Scott

"fredg" <fg******@examp le.invalidwrote in message
news:1e******** *************** ******@40tude.n et...
On Wed, 22 Nov 2006 07:31:41 +0800, Scott wrote:
>I would like to automatically change the first letter to upper case and
keep
the rest intact of each sentence on a control of a form, i.e., i am going
to
school. see you in the afternoon. -I am going to school. See you in
the
afternoon. Is there any functions to do this job?

Thanks,

Scott

Only if each record consists of just one sentence.

=UCase(Left([FieldName],1) & LCase(Mid([FieldName],2))

and then it will also change any letter which is supposed to be
capitalized in the middle of the sentence into lower case.

"I saw mary jane visiting the ibm exhibit at the california state
fair."
I don't think that is what you are looking for.

Best to take the same amount of care in writing as you do in some
other activity you have an interest in. <g>
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Nov 22 '06 #6
Freg,

You are right. I got Proper case in Google but it is not I want. At least,
I would like to only change the 1st letter to upper case on each control.

Thanks,

Scott

"fredg" <fg******@examp le.invalidwrote in message
news:1u******** *************** *******@40tude. net...
On 21 Nov 2006 16:51:37 -0800, Tony Gardner wrote:
>Scott
Google 'proper case'. Does this answer your question.
tony gardner

Scott wrote:
>>I would like to automatically change the first letter to upper case and
keep
the rest intact of each sentence on a control of a form, i.e., i am
going to
school. see you in the afternoon. -I am going to school. See you in
the
afternoon. Is there any functions to do this job?

Thanks,

Scott

Proper case, if I'm not mistaken, capitalizes the first letter of each
word, i.e. "This Is Proper Case."
The poster asked for the first letter of each sentence to be
capitalized, which would indicate that the field contained more than
one sentence.
Even if he searched for the period in each sentence and capitalized
the next letter, it still would not properly work, as many sentences
include periods that are not just at the end of the sentence, i.e.
"Mr. John C. Jones of L. A. Industries."

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Nov 22 '06 #7
Scott wrote:
Freg,

You are right. I got Proper case in Google but it is not I want. At least,
I would like to only change the 1st letter to upper case on each control.
Maybe this air code is a start:

Public Function SentenceCase(By Val StringToBeConve rted As String) As
String
Dim RE As Object
Dim Matches As Object
Dim Match As Object
Set RE = CreateObject("V BScript.RegExp" )
With RE
.Global = True
.Pattern = "(([\.\?\!])(\s)*([a-z]){1})|^[a-z]{1}"
Set Matches = .Execute(String ToBeConverted)
For Each Match In Matches
StringToBeConve rted = _
Replace(StringT oBeConverted, Match, UCase(Match), , 1)
Next Match
End With
SentenceCase = StringToBeConve rted
' I think the next line is not required
Set RE = Nothing
End Function

Nov 22 '06 #8
Lyle,

Many thanks for your useful code that works to my requirement.

Scott

"Lyle Fairfield" <ly***********@ aim.comwrote in message
news:11******** **************@ m7g2000cwm.goog legroups.com...
Scott wrote:
>Freg,

You are right. I got Proper case in Google but it is not I want. At
least,
I would like to only change the 1st letter to upper case on each control.

Maybe this air code is a start:

Public Function SentenceCase(By Val StringToBeConve rted As String) As
String
Dim RE As Object
Dim Matches As Object
Dim Match As Object
Set RE = CreateObject("V BScript.RegExp" )
With RE
.Global = True
.Pattern = "(([\.\?\!])(\s)*([a-z]){1})|^[a-z]{1}"
Set Matches = .Execute(String ToBeConverted)
For Each Match In Matches
StringToBeConve rted = _
Replace(StringT oBeConverted, Match, UCase(Match), , 1)
Next Match
End With
SentenceCase = StringToBeConve rted
' I think the next line is not required
Set RE = Nothing
End Function

Nov 24 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2913
by: Christian Buck | last post by:
Hi, i'm writing a regexp that matches complete sentences in a german text, and correctly ignores abbrevations. Here is a very simplified version of it, as soon as it works i could post the complete regexp if anyone is interested (acually 11 kb): (?:+|(?:\.|\d+\.|a\.?A \.)){3,}+(?!\s)
112
4007
by: Tom | last post by:
This is very strange: I have a Windows Form with a Panel on it. In that panel I dynamically (at run time) create some labels, as so: for i=1 to x dim ctlNew as New Label() with ctlNew .Name="Whatever" & trim(cstr(i)) .Text=.Name .Visible=True ... etc etc etc ...
2
5149
by: jon|k | last post by:
hi all-- i need to do a transformation that removes duplicates (among other things). to accomplish that, i'm trying to use for-each-group, but it doesn't work. i need to select for duplicates by looking at the child node sequence (see sample below). note that when i do an xsl-message on the group-by expression inside the for-each-group, it has exactly what i'd like to group by listed, but i guess it doesn't like to have a sequence of...
10
2082
by: Sidhu | last post by:
Hoe to relplace the word in sentence? Can any one send program?
6
1958
by: mike | last post by:
Hello, I am trying to write some code to parse a sentence and hyperlink just the words in it. I used Aaron's code from an earlier question as a start. So far, all the code does below is hyperlink everything separated by a space, which means stuff like "work." "happy." "Well;" "not." from the sentence become hyperlinks (whereas im interested in just the words themselves becoming hyperlinks and the punctuation staying nonhyperlinks). ...
3
5599
by: dalearyous | last post by:
ok basically i need to write a program that will replace normal words in a sentence with pirate words. the trick is it needs to be able to take two word phrases. i went about this two different ways: 2d array and hashmap. both have the problem of translating a phrase with two words. im running out of time and need help bad. HASHMAP WAY: import java.util.HashMap; import java.util.Map; import java.util.Scanner; import java.awt.*; import...
4
6551
by: wohast | last post by:
Hi, I'm stuck at the very beginning of my current assignment. I just need a little help getting started, and then I know how to do everything else. ask user: "Please enter your name followed by a positive integer between 1 and 9999 enclosed in parentheses, such as Cupid(1442)." how do i use substring to take out just the name that they enter, so that it starts at the first letter they enter, and ends at the (? also how do i use the...
12
3980
by: jackson.rayne | last post by:
Hello, I am a javascript newbie and I'm stick at one place. I have a requirement where I will get a sentence in a variable example var v1 ="This is a sentence"
1
4342
by: fellya | last post by:
Hi, i don't have enough experience in writing codes in Python but now i'm trying to see how i can start using Python. I've tried to write a simple program that can display a sentence. now my problem is how to write a code using split function to split that sentence into words then print out each word separately. let me give u an example: >>>sentence=" My question is to know how to write a code in Python" then the output of this...
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8838
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7351
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.