/*Name:replace(Supplementary:To be not complicated,assume that the length of the string after replaced is not greater than 1024 bytes.)
Function:to replace substring s1 in string source with substring s2
Parameters:source,string supposed to hold substring
s1,substring to be replaced
s2,substring to replace substring s1
flag,case-sensitive flag,
1,case-sensitive
0,non-case-sensitive
Return values: number of substrings haved been replaced*/