Common effects on Weibo or forums: when inserting an emoticon into a text domain, a string similar to [Haha] is displayed. Below is a method to convert an emoticon string to an image emoticon.Copy codeThe Code is as follows: Copy codeThe Code is as follows:Var face = {'[Haha]': '', '[sweating]': ''} // For the complete QQ expression, see the end of this ArticleVar reg =/\ [. +? \]/G;Var str = '[Haha] abc [sweating] [sweating]'; // here is the value of the obtained text field. For simplicity, str
When you select an emoticon to insert a text field, a string similar to [Haha] is displayed. Below is a method to convert an emoticon string to an image emoticon, which is common in Weibo or forum, when you select an emoticon to insert a text field, a string similar to [Haha] is displayed. Below is a method to convert an emoticon string to an image emoticon.
The Code is as follows:
Abc
The Code is as follows:
Var face = {'[Haha]': '', '[sweating]':''} // For the complete QQ exp
You have a large function where the use of local variables makes it impossible to use the extract method (extraction function ).Put this large function into a single object, so that local variables become fields in the object. Then you can break down this large function into multiple small functions in the same object.
Motivation: the presence of local variables increases the difficulty of function decomposition. If local variables in a function are flooded, it is very difficult to break down
Replaces the URL in a paragraph of text entered by a user with a link address that can be clicked. For example: Http://www.111cn.net can replace [Url]http://www.cctv.com[/url]
or
The key to this is to match the link, after matching, add a tag and attributes on both sides is not a problem.
/http://[w-]* (. [ w-]*) +/ig first match http://.
[w-]* is possible www and BBS etc.
. [w-]* match. XXX form, at least one.
The test code is as follows:
Copy Code code as follows:
function fn ()
{
for (var i = 0;i Alert ("First" + (i+1) + "value of parameter:" +arguments[i]);
}
}
var str = ' Str.replace (/\{([a-z]+) \}/ig, FN);
Based on multiple tests, the output results can be drawn from the FN:
The first parameter is a matching string, such as {wo} and {ni};
The second argument can have 0-n, matching the first argument to a regular string of parentheses, such as Wo and NI in the first argument, to match ([a-z]+),
There a
This example describes a JavaScript regular expression that replaces the phone number with replace (). Share to everyone for your reference.
The implementation methods are as follows:
Copy Code code as follows:
I hope this article will help you with your JavaScript programming.
1. All non-numeric characters for replacing a field are blankUpdate mobileNo_batchreg_black set mobile_no =Replace (Replace (Replace (Replace (Replace (Replace (Replace (
1. All non-numeric characters that replace a field are empty
Update Mobileno_batchreg_black Set mobile_no=
Replace
Replace
Replace
Replace
Replace
Replace
DBF -------------- Excel
1. Files in VFP --- Export
Type: excel5.0
To: where you store Excel files
2. Modify the data you want to modify in excel5.0, and convert the data with a triangle in the upper left corner to Data.
3. Save as:
VFP database files are generally backed up in two forms. One is a record format, that is, a VFP table (. DBF) for storage. The advantage of this method is that the table data is backed up as is, note fields, common fields, and other special fields
1. Landing interface
2. System function Menu
3. Powerful and complete data entry function
4. Perfect log function
5. Input, modify, delete the human machine operation Interface Unified, reduce the
addtable Add a free table to the current databaseAPPEND add one or more new records at the end of the tableAPPEND from array add record to tableAPPEND from a file, appended to the end of the current tableAPPEND General import OLE objects from a file
Each time msdn98 is installed, you must attach two CDs. After CD1 is installed, the optical drive is placed into the CD2 drive to correctly guide the installation program to complete the entire installation. If there is no optical drive on the
1. Landing interface
2. System function Menu
3. Powerful and complete data entry function
4. Perfect log function
5. Input, modify, delete the human machine operation Interface Unified, reduce the
Original source
Finally finish the DBF file read and write Java source code, welcome to use
Modify the following code
private void init (InputStream inputstream) throws jdbfexception { try { stream =
MySQL Replace instance description:
UPDATE tb1 SET f1=replace (F1, ' abc ', ' Def ');
REPLACE (STR,FROM_STR,TO_STR)
All occurrences of the string from_str in string str are replaced by TO_STR, which then returns the string
This function is useful for bulk substitution of illegal keywords in data! The following example:
Example 1:update bbstopic SET tcontents
Because of my ignorance, and because of the fact that I was rarely involved in the development of the database module in the previous project, I realized that the Sqlite database also supports the replace statement a few days ago. This article mainly explains the replace statement behavior in Sqlite, which is also a learning note. In addition, replace statements
Describes how to use the JS Regular Expression replace and the jsreplace
Before talking about the advanced application of replace, let's sort out several important knowledge points in JS regular expressions to help you review your basic knowledge, then I will explain how to use the JS Regular Expression in replace and several typical cases.
I. Create a regular ex
Because of their own ignorance, but also because of previous projects, very little involved in the development of the database module, so that a few days ago that the SQLite database also supports the Replace statement. This article mainly explains the behavior of the Replace statement in the SQLite, also is the study notes. In addition, the Replace statement and
We often use the MySQL replace function. The following describes the usage of the MySQL replace function in detail, hoping to enlighten you in learning the MySQL replace function.I recently studied CMS and used mysql replace function during data conversion. Here I will briefly introduce it.For example, you want to
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.