Recommended: parse the difference between function and sub in asp programming Functions or procedures defined in function may have return values, while functions or procedures defined in sub do not return values. For example: functiontestvalue() testvalue=If you are hungry, you have to eat. hoho' function is called the return value endfunction subtestsub() Response.Write(If you are hungry, you have to eat. hoho) endsub Call these two functions in the program
Use this function to return the number of times a character or character string appears in a string. MainStr is the string to be searched and subStr is the string or character to be checked.function countInstances(mainStr, subStr) { var count = 0; var offset = 0; do { offset = mainStr.indexOf(subStr, offset); if(offset != -1) { count++; offset += subStr.length; } }while(offset != -1) return count; } |
Share: How to obtain the ID number of the record that has just been inserted into the database? 1.SQL Server For SQL Server 2000, it provides two new functions (IDENT_CURRENT, SCOPE_IDENTITY), and improves the shortcomings of @@IDENTITY. When you insert a new record, you can call the function: PRINT IDENT_CURRENT('table ') 'This will get the new IDENTITY value regardless of whether there are records in the database (this avoids