Re: Capitalizing the first letter



Hello Again,
You can use ucwords() functions except my method. This function
returns a string with the first character of each word in str capitalized,
if that character is alphabetic. :)

--
Haydar TUNA
Republic Of Turkey - Ministry of National Education
Education Technology Department Ankara / TURKEY
Web: http://www.haydartuna.net

Hello,
In PHP ucfirst() function make a string's first character uppercase.
But ralph smith have two words respectivetely ralph and smith. For this
reason, if you call the ucfirst("ralph smith") function, you cannot see
the Ralph Smith. You see the Ralph smith. If you want to see Ralph Smith
string, you should use explode() function. With this functions, you
returns an array of strings, each of which is a substring of string formed
by splitting it on boundaries formed by the string delimiter.In the ralph
smith delimeter characeter is blank line. You can use like a following
examples in your code:)

<?php
$yourname = "ralph smith";

$name = explode (" ", $yourname);

$yournewname = ucfirst( $name[0] ) . " " . ucfirst ( $name[1] );

echo ( $yournewname );
?>

--
Haydar TUNA
Republic Of Turkey - Ministry of National Education
Education Technology Department Ankara / TURKEY
Web: http://www.haydartuna.net

"Todd Cary" <todd@xxxxxxxxxxxxxxxxxx> wrote in message
news:B5.10.34414.CB0B6F54@xxxxxxxxxxxxxxx
I would like to write a filter that takes the text "smith" or "SMith" and
returns "Smith"; same for "ralph smith". Is the a good source on using
filters this way?

Thank you...
.



Relevant Pages

  • Re: Capitalizing the first letter
    ... Education Technology Department Ankara / TURKEY ... In PHP ucfirstfunction make a string's first character uppercase. ... But ralph smith have two words respectivetely ralph and smith. ... string, ...
    (php.general)
  • Re: Capitalizing the first letter
    ... Education Technology Department Ankara / TURKEY ... In PHP ucfirstfunction make a string's first character uppercase. ... But ralph smith have two words respectivetely ralph and smith. ... string, ...
    (php.general)
  • Re: Data String Manipulation
    ... Function MakeString(Scan As String) As String ... Dim Ret As String ... GoTo Exit_Func ... always need to delete the first character in the scanned string, ...
    (microsoft.public.access.modulesdaovba)
  • Re: LPCWSTR to CString conversion problem
    ... I get the first character of the string and pass it to ... LPCWSTR to CString conversion. ... Do you compile as Unicode or Ansi? ... GetAtreturns the second character of the string, ...
    (microsoft.public.vc.atl)
  • Re: Converting Type Characters to type string
    ... used to determine whether or not the input was a integer roman numeral ... advice and are using Get_Line to read an entire string first, ... look at the first character of the string to see whether it's Q or a ... can still convert the entire input string using Integer'Value. ...
    (comp.lang.ada)

Loading