473,786 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to replace each first letter of a word into capital letter :

51 New Member
Hi all, i'm currently struggling to perform the above mentioned replacement.

i already know how to catch the first letter in each word and determined if it's regular or capital.

however, i don't know how to replace this letter with it's corresponding capital letter.

perhaps there is an option to change the ascii value of the a character in perl regexp ?

for example :

Hello hello word --> Hello Hello World

many thanks for your help.
Sep 14 '09 #1
4 5571
RichKersh
3 New Member
Expand|Select|Wrap|Line Numbers
  1. my $t="hello hello word";
  2. $t=~s/(\b)(\w)/$1\u$2/g;
  3. print $t;
  4.  
Sep 14 '09 #2
zcabeli
51 New Member
hey, thanks for the help ! i really appreciate it.
can you explain what does the '\u' symbol means, i haven't found it in any perl documentation
Sep 14 '09 #3
RichKersh
3 New Member
perldoc perlre

...
\u uppercase next char (think vi)
...
Sep 14 '09 #4
zcabeli
51 New Member
thanks again, i found all i need (and much more) in perlre
Sep 14 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
3860
by: vertigo | last post by:
Hello How can i change big letter to small letter ? When i tried char=char+32 i received error that can not add int to sring. Thanx Michal
0
2417
by: MDW | last post by:
Mystring = Left(Mystring,Len(Mystring) - 1) Mystring = Mid(Mystring,2) That should do it. >-----Original Message----- >How can I replace first as well as last "," in a string? > >Mystring = ",3,2,5,6,1,65,22," >
1
2111
by: peteyjr | last post by:
Hi I have a asp page with a database connection where I need to export adresses into a MS Word Serial Letter. Is this possible and if how?? Any help is well appreciated Peter
7
4818
by: Barry | last post by:
Hi all, I've noticed a strange error on my website. When I print a capital letter P with a dot above, using & #7766; it appears correctly, but when I use P& #0775 it doesn't. The following capital letters all work correctly - B C D F G M S T with the diacritical marker &#_0775. Why am I having a problem with P?
1
2676
by: Marc Verdonck | last post by:
First: I have some troubles in access, some fields needs to begin with a Capital letter. Example: louiselaan need to be Louiselaan. How can I become this? Second: I'm exporting my database to outlook. Than some names begin with a capital letter some don't. The name is always in capital letters in access and in outlook sometimes it's capital sometimes not.
1
2131
by: peteyjr | last post by:
Hi I have a asp.net page with a database connection where I need to export adresses into a MS Word Serial Letter. Is this possible and if how?? Any help is well appreciated Peter
5
4604
by: Wasim Akram | last post by:
Hi all, String.Replace replaces all occurrances of a substring in a given string . Can anyone guide me how can I replace first occurrance of a substring in a given string. - wa
8
12483
by: =?gb2312?B?yMvR1MLkyNXKx8zs0cSjrM37vKvM7NHEsru8+7z | last post by:
I lookup the utf-8 form of delta from the link. http://www.fileformat.info/info/unicode/char/0394/index.htm and then I want to print it in the python ( I work under windows) #!/usr/bin/python #coding=utf-8 print "\xce\x94"
5
2747
by: Moham12345 | last post by:
How can i detect if there is more then capital letter in a word?
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9492
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
10163
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
9960
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
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
7510
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
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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.