NSString + Check, iOS determines whether the mobile phone number format is correct
Usage: create a class that inherits from NSString, import the NSString + Check. h header file, and determine the value of the string (checkPhoneNumInput) YES or NO.
// NSString + Check. h
// Ics
//
// Created by Casystar on 15-4-2.
// Copyright (c) 2015 dong. All rights reserved.
//
# Import
@ Interface NSString (Check)
-
# I = 3# Username = "yangxiaoer"# Password = "123456"# While I> = 0:# Name = input ("Enter your Username :")# If name = Username:# Passwd = input ("enter your password :")# If passwd = password:# Print ("Logon successful. Please wait ")# Print ('''# Username: % s# Password: % s# ''' % (Username, password ))# Break# Else:# Print ("Your password is incorrect. Please enter it again ")# Print ("You still have % s chances" % (I-1 ))# If I = 0:# Print ('your chances are used up, end this operation ')#
public class Test {public static void Main (string[] args) {Int[] A = new int[400];Int[] B = new INT[50];for (int i = 0; i A[i] = (int) (Math.random () * 50);}System.out.println ("Randomly generated array is:");for (int i:a) {System.out.print (i+ "");}for (int i = 0; i for (int j = i + 1; j > 0; j--) {if (A[j] int temp = A[j];A[J] = a[j-1];A[J-1] = temp;}}}System.out.println ("\ n the sorted array is:");for (int i:a) {System.out.print (i+ "");}for (int i = 0; I int temp = 0;for (int j = 0 + temp
Integer (number of seconds) conversion last minute and second format (XX:XX:XX)
Copy Code code as follows:
A integer to Xx:xx:xx
public static String sectotime (int time) {
String timestr = null;
int hour = 0;
int minute = 0;
int second = 0;
if (Time return "00:00";
else {
minute = TIME/60;
if (minute Second = time% 60;
Timestr = Unitformat (minute) + ":" + unitformat (second);
} els
Tag:rettimestyledouble Get stringcolorintpublic Public String Timechange (double time ) { int hour= (int) (time/3600); int minute= (int) (time%3600/60); int second= (int) (time%3600%60); return (hour>10?) ("" +hour):("0" +hour) + ":" + (minute>10? ("") +minute):("0" +minute) + ":" + (second>10? ("") +second):("0" +second)); }Converts the number of seconds fetched from the database to the 00:00:00
(1) Screening data in a DataTable:
DataTable dt=new DataTable ();
DataView Dv=dt. DefaultView;
Dv. Rowfilter=string. Format ("Name={0} and Namet={1}", Value,valuet);
DataTable NEWDT=DV. ToTable ();
(2) When the query is made according to the time period condition
Data SQL statements in the conditional: SJ between SJ1 and Sj2
To format the obtained string string when fetching data in the background:
String
The database is clearly the time to return but become a string of irregular numbers. Solving method
/*** Time stamp Turn time format* Number of times of @param jsondate*/
function Getlocaltime (jsondate) {Jsondate= "" +jsondate+ "";//Because Jsondate is a number type, indexof will complain.if (Jsondate.indexof ("+") > 0) {Jsondate = jsondate.substring (0, Jsondat
The number of times the Map set app retrieves letters from a string. For example: String: "abcdekka27qoq", output format: a (2) B (1) k (2)..., mapabcdekka27qoq
Package com. swift; import java. util. hashMap; import java. util. iterator; import java. util. map; import java. util. map. entry; import java. util. set; public class Test3_String_char {public static void main (String [] args) {/** 4th question: t
In statistical legends, what are the most basic and important elements? That is data. A statistical image of a piece of data is a pile of blank space. However, there are multiple forms of data, such as decimal places, such as kilobytes. If the data size is 12.000000001, but the data requirements are not very strict, won't you show it that way? Therefore, we often need to control data formats in statistical reports.1. Control decimal places
FusionCharts has a decimal point retention attribute: de
Start by inputting all the numbers (or exporting them) to the pound + number format, such as "#3333333323424234234234", and then run the following macro:Sub num2text () If not TypeOf application.selection are Range then MsgBox ' You must select Cells! ' Return End If for each cell in Application.Selection.Cells if cell. Text Macros used by Excel to set the cell to a
The game suit began to serve, the result reported disorderly seven or eight strokes of error, first CCS that IP has a problem, I gave directly commented out, and then reported Keyvaluedictcache in the IPs set problems, are reported format error, the results of my breakpoint is clearly digital results in judging the number that is still an error, the result I want to estimate Meter is a tm coding problem, or
SQL format execution sequence of oracle data structure and sequence number of SQL query processing, oraclesql
I. execution sequence of SQL format
FROM-> WHERE-> group by-> HAVING-> SELECT-> ORDER
1. The from clause assembles data from different data sources;
2. The where clause filters record rows based on specified conditions;
3. The group by clause divides dat
how to format a phone number in PHP
The example in this article tells you how to format a phone number in PHP. Share to everyone for your reference. The specific analysis is as follows:
This function applies only to American phones, and Chinese phones need to be modified by themselves
?
1 2 3 4 5 6 7 8
The conversion string format is the character in the original string + the number of consecutive occurrences of the character. For example, 1233422222 is converted to 1121324125 (1 appears once, 2 appears once, 3 appears twice ......
Similar to this question: In a word list of ultra-large text, count the number of times each word appears.
Method:
Define two va
How to format a number? For example, if I only want to get the number after the decimal point, it is 0.21951100. can I do this without using the explode function?
Reply to discussion (solution)
Convert to string type, and then use substring to extract digits after the decimal point.
Many methods Just give one
$ A = "0.21951100"; echo substr ($ a, strpos (
/*Purpose: Verify the format of IP addressInput: Strip:ip AddressReturns: False if return true through validation;*/Java code
1. function f_check_ip (obj)2. {3. Var re=/^ (d+). (d+). (d+). (d+) $/; Regular expressions that match an IP address4. if (Re.test (Obj.value))5. {6. If (regexp.$1 7.}8. F_alert (obj, "Please enter a legitimate computer IP address");9. return false;10.}11.
function F_check_ip (obj){var re=/^ (d+). (d+). (d+). (d+) $/; R
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.