Method One:The varchar and nvarchar types are support for replace, so if your text does not exceed 8000 you can first convert to the previous two types and then replace the text ntext data type field with replace statement. Update table name set
php5.2 upgrade to 5.3, the original & new writing has been abandoned, can be directly new, face hundreds of PHP files, manual modification is really want to kill, so wrote a script, minutes to get it done.
The code is as follows:
#-*-Coding:utf-
Title Description Implement a function that replaces a space in a string with "%20". For example, when the string is we are Happy. The string after substitution is we%20are%20happy.public class Solution2 { public static String Replacespace
In PHP, there are several character substitution functions, such as: Str_replace, Substr_replace, Preg_replace, Preg_split, Str_split and other functions, let me give you a summary of the introduction.
Yi, Str_replace
The example in this article describes jquery's method of implementing a full string replacement. Share to everyone for your reference, specific as follows:
Unlike the C # String type Replace method, the replace of jquery can only replace the first
1: Replace with the String.Replace function, but not case-supported.
2: Regular System.Text.Regex replacement, with regexpoption modify whether or not to support case.
3: In the case of small data, the use of string.substring and + can achieve
Parameter description:
//In, source string
//out, the string that holds the final result//
outlen,out max size
/src, the string to replace/
/DST, replace into what string
Char *STRRPL (char *in, char *out, int outlen, const char *SRC, char *dst)
{
function insertstring (MAINSTR,SEARCHSTR,INSERTSTR) {
var front=getfront (MAINSTR,SEARCHSTR);
Foundoffset=mainstr.indexof (SEARCHSTR);
if (foundoffset==-1) {
return null;
}
var front = mainstr.substring (0,foundoffset);
var end =
php5.2 upgrade to 5.3, the original & new writing has been given up, you can directly new, in the face of hundreds of PHP files, manual modification is really want to kill, so wrote a script, minutes to fix.
Copy Code code as follows:
#-*-
Can be reproduced arbitrarily, but the reprint must be marked original author Charlee, the original link http://tech.idv2.com/2006/11/23/javascript-strreplace-benchmark/and this statement
I benchmark these two functions and found that the
1, Str_ireplace () function
Replaces the string in the original string that was specified to be replaced with the new string. The Str_ireplace () function is not case-sensitive when it is manipulated.
Syntax format:
Str_ireplace (STR2,STR1,STR)
The Str_replace () function replaces some characters in a string with other characters (case-sensitive). This article focuses on the PHP string replacement str_replace () function four kinds of usage, interested friends to see together
The
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
I have the following lines:
D:\PROJECTS\QQQ\DEVELOPMENT\QQQ. MySol1.slnD:\Projects\qqq\qqqDevelopment\qqqMySol2.slnD:\Projects\qqq\Development\MyInstaller.slnD:\Projects\qqq\qqq\Development\MyInstaller.slnD:\Projects\Development\MyInstaller.sln
I
Replace functionReturns a string in which a specified number of substrings are replaced with another substring.
Replace (expression, find, replacewith[, compare[, count[, start]])
ParametersExpression
Required option. A string expression contains
This article illustrates the substitution, segmentation, and connection methods of PHP strings. Share to everyone for your reference, specific as follows:
Substitution of strings
1. Perform search and replace of a regular expression
Copy
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.