473,382 Members | 1,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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

51
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 5528
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
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
perldoc perlre

...
\u uppercase next char (think vi)
...
Sep 14 '09 #4
zcabeli
51
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
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
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 =...
1
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
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...
1
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...
1
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
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
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...
5
by: Moham12345 | last post by:
How can i detect if there is more then capital letter in a word?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.