[, string charlist]), where charlist is an optional parameter, specifying the deleted string, if carried, delete the specified character, if not carried, delete all optional characters.
Optional characters include \ 0 (null), \ t (TAB), \ n (linefeed), \ x0B (vertical tab), \ r (carriage return), and "" (space)
2. escape character strings.Escape character strings can be manually converted or automatically escaped.Manually escape: use the escape character "\", for example:Echo "this's a \" cat
Craigslist is the beginning of the Internet classification information site, because he has been doing for more than 10 years, so, say good is focused, say ugly is like snail development.
is Craigslist a successful case? There's a lot to say, but I think it's American. Lian Cheng Network does not do China's Craigslist, only to do China's city network, the world's City network. One day, we want to let Americans know about the city network. Connect their city to the same. The following article, t
() {}test (1,a=2) #output: 1 1 () {' A ': 2}test (1,2,3,a=4) #outpu T:1 2 (3,) {' A ': 4}test (1,2,3,y=4) #output: Traceback (most recent call last): File "Delivery list IssuesThere are three ways, which are positional parameters, key parameters, and meta-group arguments, respectively. However, in a tuple argument, you need to use the list method to convert the tuple to a list.Position parametersdef func (names): print (names) names[1] = ' Jujinyi ' names = [' Aaron ', '
", "SD")Do an experiment:
>> h = hash.new=> {}>> h["a"] = 1=> 1>> h["a"] = 2=> 2>> puts h["a"]2=> NilGet value
With the [] method:
>> p_hash["Beijing"]=> "BJ"You can also use the Fetch method:
>> p_hash.fetch ("Beijing")=> "BJ"[] The difference from the fetch is that there is an exception when you fetch a key that does not exist, and [] returns nil.
>> P_hash.fetch ("Yunnan", "Unknown State")=> "Unknown State"Multiple key:
>> p_hash.values_at ("Beijing", "Shanghai")=> ["BJ", "SH"]Default h
arguments object, where the object is being booted.
So, when executing, this means arguments, because two parameters are passed, so the output is Arguments.length 2 3. Constructor mode (constructor pattern, constructor mode)
Constructor
Features: booting using new keyword
Execute step: var p = new person ();
New is an operator that is specifically used to request the creation of an object, and the created object is passed to this constructor. The constructor is then initialized with the constru
Str_replace () function definition: Use a string to replace some other characters in a string, the case-sensitive search syntax: Str_replace (Find,replace,string,count) str_ireplace () function definition: Use a string to replace some other characters in a string with the case insensitive search syntax: Str_ireplace (Find,replace,string,count)Str_replace detailedWhen you do not use an array, the function uses replace directly to replace all search and return the replaced string. such as: Str_rep
Question link: Ah, haha, click me
Give n monsters the range of cards they can get and the damage this monster has caused to the hero .. And finally obtain the minimum damage the monster has to the hero .. Train of Thought: sort the damage caused to monsters from big to small, and then enumerate the N monsters one by one. During enumeration, reverse enumeration is performed on the time, then, the damage caused by the access is reduced to 0, and the statistics are as follows. Question: A Bunch Of
Detailed description of the str_replace function of PHP. During the actual period, we read the PHP function str_replace in the book PHP and MySQLWeb development. a small prompt says: we can use arrays for all three of str_replace.During this time, I read the book "PHP and MySQL Web development" and saw the PHP function str_replace explanation. I wrote a small note: Three of str_replace can be passed in using arrays, but the explanation is relatively simple, so I decided to test the execution res
Userlist_enable and chroot_list_enable configurations in the VSFTPDFirst, the demand1. Only want to allow the designated account to login FTP, other local accounts are not allowed to log in FTP.2. Only if the specified account is not restricted to its home directory, other accounts are restricted to its home directory.Second, let the designated account can login FTP, other local accounts are not allowed to login FTP.To verify the effect we built two users Tom and
This time in reading "PHP and MySQL Web development" a book to see Str_replace explanation, a little hint to write: can be used in the array of Str_replace three, but the explanation is relatively simple, so decided to experiment with the function in the parameters of each parameter when the execution results.
Function prototype: Mixed str_replace (mixed needle,mixed new_needle,mixed haystack[,int count]);
Needle: String to be replaced, New_needle: replacement string, Haystack: action string, Co
During this time, I read the book "PHP and MySQL web development" and saw the str_replace explanation. I wrote a small note: Three of str_replace can be passed in using arrays, but the explanation is relatively simple, so I decided to test the execution result of the function when each parameter is passed into the array.
Function prototype: Mixed str_replace (mixed needle, mixed new_needle, mixed haystack [, Int COUNT]);Needle: string to be replaced, new_needle: string to be replaced, hayst
, and ice cream every day$phrase = "You should eat fruits, vegetables, and fiber every day.";$healthy = Array ("Fruits", "vegetables", "fiber");$yummy = Array ("Pizza", "beer", "ice Cream");
$newphrase = Str_replace ($healthy, $yummy, $phrase);
Use of the Count parameter is available as of PHP 5.0.0$str = Str_replace ("ll", "" "," Good Golly Miss Molly! ", $count);Echo $count; 2?>");
The code is as follows
Copy Code
Str_replace detailedWhen you do not use an array, the f
ForThis time in reading "PHP and MySQL Web development" a book to see Str_replace explanation, a little hint to write: can be used in the array of Str_replace three, but the explanation is relatively simple, so decided to experiment with the function in the parameters of each parameter when the execution results.
Function prototype: Mixed str_replace (mixed needle,mixed new_needle,mixed haystack[,int count]);
Needle: String to be replaced, New_needle: replacement string, Haystack: action string
Function Definition
Def Hello (name, age = 10, Gender = 'F '):
Print 'user info :'
Print 'name is % s' % name
Print 'Age is % d' % age
Print 'gender is % C' % gender
There are several Calling Methods
Hello ('Jim ')
Hello ('Jim ', 11)
Hello ('Jim ', 11, 'M ')
The above three methods use default parameters, similar to C ++
Hello ('
: Prototypes allow you to create new objects based on existing objects without having to create custom types. it requires that an object be used as the basis for another object. functionObject (o) {functionF () {}; F.prototype=N; return NewF (); } varperson={name:' Nicho ', friends:[' Shell ', ' Jim ', ' Lucy '] } varAnotherperson =object (person); Anotherperson.name= ' Greg '; AnotherPerson.friends.push (' Rob '); Console.log (anotherperson.
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.