This article describes how to compile a PHP program to check the number of Chinese characters in a string. In this article, we use the implementation principle of the mb_strlen function in PHP, for more information about how to calculate the number of words in a string
The strlen function can be obtained, but what if the string contains Chinese characters? Mb_str
ASP to judge telephone number and email address program
Function IsValidEmail (email)Dim names, Name, I, CIsValidEmail = Truenames = Split (email, "@")If UBound (names) IsValidEmail = FalseExit FunctionEnd IfFor each Name in namesIf Len (Name) IsValidEmail = FalseExit FunctionEnd IfFor i = 1 to Len (Name)c = LCase (Mid (Name, I, 1))If InStr ("abcdefghijklmnopqrstuvwxyz_-.", c) IsValidEmail = FalseExit Func
/*-----------------------------------------------------
several colleagues in a variety of requirements, for them to write this program, and I never buy lottery tickets, do not understand.
But if you're really in the jackpot, don't forget to tell me, Chiang Yo, what? Afraid I'll share your money?
I do not greedy, the most send me a classic music disc I am very happy!
by Jianglixin@163.net (hastily written, code messy collation) 2001.2.28
---
Example of the shopping cart program. The number of purchased items can be displayed.
Goods_list = [("IphoneX", 9000), ("Tesla", 700000), ("Python book", 55 ),("Coffee", 35), ("Computer", 6999), ("Bitcoin", 67000), ("Food", 20), ("TV", 5000)]Shopping_car = []Cost = 0.0
Print ("Welcome to the shopping market, here is your shopping car .")Print ("You can enter 'q' to quit at anytime .")Print ("You can enter '
::*) (void) to LRESULT (__thiscall CWnd::*) (Wparam,lparam) 2010-05-13 11:35 the development platform was upgraded from VC6.0 to VS2005. The original project needs to be migrated and may encounter a similar error:Error C2440: ' static_cast ': cannot convert from ' void (__thiscall CMainFrame::*) (void) ' to ' LRESULT (__thiscall CWnd::* ) (Wparam,lparam) '
VS2005 to check the message more stringent, once VC6 under the completely normal execution of the message map under VS2005 compilation does
The first type:#include int main (){int zheng,i;int m=0;int yu[10];int count=0;scanf ("%d", m);Zheng=m;for (i=0;iif (zheng!=0){yu[i]=zheng%10;ZHENG=ZHENG/10;count++;}for (i=0;i{printf ("%d", yu[i]);}return 0;}The second type:#include int main (){int num = 0;int i = 0;int arr[10];int left = 0;int right = 0;int j = 0;scanf ("%d", num);while (NUM){Arr[i] = num% 10;num = NUM/10;i++;}Reverse the elements inside the arr[4]right = I-1;while (left {int tmp = Arr[left];Arr[left] = Arr[right];Arr[right] =
/**Some solutions to the idea of bit operation.Swaps the values of m=12 and n=5.*/Class WeiExercise1{public static void Main (string[] args){Method One/*int temp=0;int m=12;int n=5;Temp=m;M=n;n=temp;*/Method Two/*int m=12;int n=5;M+=n;N=m-n;m=m-n;*/Method three-bit operation (M^n) ^m==n, (m^n) ^m==nint m=12;//1100int n=5;//0101m=m^n;//or 1001=mn=m^n;//or 0101=1101m=nm=m^n;//m=1001, n=1101== (m^n) ^m==nSystem.out.print ("m value is +" +m+ ", n value is +" +n);}}"Song Hongkang
Sometimes we need to determine if the application has multiple threads enabled, at which point it can be judged by getting the thread number (the Thread.Name property value is often null and cannot be used for judgment):
The code is as follows
Copy Code
Using System;Using System.Threading; Namespace ConsoleApplication1{public class Program{static public void Main (string[] args)
JSP online number of people statistics code program/*┌──────────────────── Deep Space Depth Learning ──┐│ Function Name: Onlinecount│ Role: Online population statistics│ Parameters:│ return value:│ Date: 2006/7/18└────────────────────www.deepteach.com──┘*/String Onlinecount (){T= (CInt (Date ()) *24+cint (Hour (Time ())) *60+cint (Minute (Time ()))K=0I=1Y=0Do While application ("Onlineip" i) If Application
Function: Use ASP program to generate picture format of phone number in the page.
The following is a reference fragment:
The following are the referenced contents: Call Com_creatvalidcode (Request.QueryString ("tel"))Public Sub Com_creatvalidcode (Ptel)'----------Prohibit cachingResponse.Expires = 0Response.AddHeader "Pragma", "No-cache"Response.AddHeader "Cache-ctrol", "No-cache"Response.Cont
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.