Here, I have sorted out the previous Java Study Notes and published them into multiple series, which will be released in the future.
This article is divided:
1. Object
2. String and StringBuilder
3. Regular Expression Processing in Java
4. Commons-lang
--------------------------------------------------------------
I. Object
In the Java inheritance structure, at the top is the default inheritance of the quilt class. Everything is an object!
1. toString
(1) The int ascii_to_integer (char *str) function is implemented.Requirement: This string argument must contain one or more numbers, and the function should convert the numbers to integers and return the integer. If the string argument contains any non-numeric characters, the function returns zero. Don't worry about arithmetic overflow.tip: Every number you find, multiply the current value by 10 and add the
How to correctly get the ADO connection string for MySQL, excerpt from the Web http://blog.csdn.net/zyq5945/article/details/5486393First, you correctly installed the MySQL database driver (mysql-connector-odbc-5.1.6-win32.msi)1. Create a new empty text file on the desktop mysql.txt, rename it to Mysql.udl;2. Double-click the Mysql.udl file to open the Database Connection Properties dialog box, select Micrsoft Ole DB Provider for ODBC Drivers on the Pr
This article mainly introduces Lua to get UTF8 string length and string interception and use ... Instead, this article directly gives the implementation code of two functions, the need for friends can refer to the following
First, Lua get UTF8 string length
The code is as follows:
---Get the correct length of the UTF8 encoded
The string format is required and must be YYYY-MM-DD HH:MM:SS================================================Method Two: Convert.todatetime (String, IFormatProvider)DateTime DT;DateTimeFormatInfo Dtformat = new System.globalizationdatetimeformatinfo ();Dtformat.shortdatepattern = "YYYY/MM/DD";DT = Convert.todatetime ("2011/05/26", Dtformat);================================================Method Two:datetime
Data type 1.int: numeric type. Mainly used to calculateInt:bit_length () converted to a valid number of digits in binaryi = 3i1 = int.bit_length (i) print (I1)int--->str ' int '--->str (int)2.STR: String type. Storing a small amount of data for operation with "" meansSTR--->int (only digits) str--->int (str)STR--->bool ""--->false null is False"0"--->true non-null is True3.bool: Boolean value. True, False to determineBOOL--->int True--->1False--->0Com
In the development of PHP, because of our country's language environment problems, so we often need to deal with the Chinese. In PHP, we all know that there are special MB_SUBSTR and Mb_strlen functions that can intercept and calculate the length of Chinese, but since these functions are not the core functions of PHP, they are often not open. Of course, if you are using your own server, just open it in php.ini. If the virtual host is used, and the server does not have the function to open this a
1182 Perfect string title Source: Facebook Hacker Cup selection base time limit: 1 seconds space limit: 131072 KB Score: 5 Difficulty: 1-level algorithm collection concern John thinks that the perfect degree of a string is equal to the perfection of all the letters in it. The perfect degree of each letter can be assigned by you, different letters of the perfect degree, respectively, corresponding to an inte
longest Substring without repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating to letters for ' ABCABCBB ' is ' abc ', which the length is 3. For ' bbbbb ' the longest substring is ' B ', with the length of 1.
"Analysis-not original" reference: Https://oj.leetcode.com/discuss/10747/my-accepted-solution-in-java
/* The longest substring with no
Nonsense is not much to say, the key code looks like this:
package cn.com.songjy; import Java.text.NumberFormat;//java to the left of the number 0 public class Numbe rformattest {public static void main (string[] args) {//To test data int i = 1;//Get an instance of NumberFormat NumberFormat NF = number
Format.getinstance ();
Sets whether to use group nf.setgroupingused (false);
Set the maximum number of integer digits nf.setmaximumintegerdig
Date type data sent over the front end cannot receive
And then I found a single date matching method.
@DateTimeFormat (pattern= "Yyyy-mm-dd HH:mm:ss")It's okay.
@JsonFormat (pattern= "Yyyy-mm-dd HH:mm:ss", timezone = "gmt+8")
Returns the time of the front-end string format
Reference
When querying the database, the date type returned is Java.sql.date, The browser is set to Java.util.date in a custom node object, but the sql.date loses in
Http://blog.csdn.net/sikaiyuan2008/article/details/7848926sql Server database Storage sqlSQL Server stitching strings (variables in strings) is always forgotten, reproduced to help memory.First, stitching the string (the entire string is not split) step:First, the string is preceded by a single quotation mark;The variables in the
Referenced from: 48036839One, in the composition of the SQL statement and send the command exactly according to the style in Python to pass, so when executed in MySQL encountered the wrong command, by single quotation marks or double quotation marks. Therefore, before composing a string, you should manually precede the single or double quotation marks in the string with a backslash, so that when combined in
@ Function name: strdupFunction prototype: char * strdup (const char * s)Function: copy a string. The target space is allocated by the function.Function return: pointer to the copied stringParameter description: src-source string to be copiedFile: # Include # Include # Include Int main (){Char * dup_str, * string = "abcde ";Dup_str = strdup (
String data type conversion, string Data Type
String is a final class, providing strings that cannot be modified. Forced type conversion. The String type is everywhere. The following describes some common conversions of String data types.
The
public class A { public static void Main (string[] args) { The defined string String s = "Hello world"; get the length of a string by the length method for (int i = 0;i Charat is a string that gets the I-character System.
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.