Requirements:Make sure that the first letter of each word in the string is capitalized, and the remainder is lowercase.Here I have written two methods, or one method, and the other is a variant of the method.The first type:function titlecase (str) {
Oracle function (converts the first letter of each word to uppercase)
NLS_INITCAP (x [, y])
[Function] returns a string and converts the first letter of the string to uppercase, And the other letters to lowercase;
[Parameter] x struct expression
1 str = input ('input a string ' need to change:')23 New _list = Str.split (")4 for in new_list: 5 print(I.capitalize (), end=" )When I learned the string split usage today, I suddenly thought of the front str.capitalize () capitalize the
This article mainly describes how to capitalize the first letter of each word in a string, and you need a friend to refer to theIn a string, each word is separated by a space and the number of spaces is not limited to the following code: function
There are other (hidden) requirements (otherwise, you cannot pass the test):1 If the first letter is capitalized, it does not change. 2. Not the same as the English alphabete.g.Input:hello world! This is _LJJ speaking! Output:hello world! This is
In Python, there is code that can implement this function directly
str2 = "Hello nice to meet
Print (Str2.title ())There are a couple of similar features
Convert #将字符串中的大写转化成小写 lowercase to uppercase
print (Str2.swapcase ())
#就第一个首字母大写 Other
C ++ is used to read an English text and uppercase the first letter of each English word in the text.In this program, we read the stream from a text and use the fstream stream. During text conversion, the isalpha () -- whether it is a letter,
In a string, each word is separated by a space and the number of spaces is not limited
Copy Code code as follows:
Function capitalize (Sting) {
var words = String.Split ("");
for (var i = 0; i Words[i] = Words[i].charat (0). toUpperCase (
Using C + +, read an English text and capitalize the first letter of each English word in the text.This program has practiced reading a stream from a text, using the FStream flow. During the conversion of the text, the Isalpha ()-whether it is a
Naming specification class naming
Capitalize the first letter, then capitalize the first letter of each word
Use a noun phrase that reflects the function of the class
File and class have the same name
Special class naming
ObjectiveiOS has been developing for more than a year now, has not done a good specification of code, the recent increase in the number of staff, everyone wrote code is no flower eight door, looked very unaccustomed. So the integration of some
Dynamic | specification | Web page one, directory structure
The naming rules for directory structures are in English letters or phonetic abbreviations as directory names. Specify a Readme.doc Word file in each directory, stating the file under the
Ext.: http://blog.csdn.net/zhaoxy_thu/article/details/9090963 Naming Conventionsclass namingL capitalize the first letter , then the first letter of each word is capitalizedL use noun phrases that reflect the function of the classL file and class
Java Development Naming conventionsPrecautions before use:1, due to the Java object-oriented programming characteristics, in naming should try to select the noun2. Hump nomenclature (Camel-case): When a variable name or function name is a unique
The purpose of defining the specification is to unify the code style of the project so that the program is readable.Good habits also contribute to our growth. Today, together with you, Java in the development process of the language
Java Development Naming Conventions The Writing specification (package) that summarizes the names of the packages recommends using a company or organization's top-level domain name as the prefix for the package name to guarantee the uniqueness of
The purpose of defining the specification is to unify the code style of the project so that the program is readable. All naming rules must adhere to the following rules:In Java we generally use the Hungarian notation, the basic structure of
Java variable naming convention]
Java is a case-sensitive language that distinguishes letters. The following describes the naming rules for packages, classes, and variables in Java.(1)Package)Name: the package name isA lowercase wordFor
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.