Tag:Character string

  • Java string truncation

    Time:2020-4-6

    import org.apache.commons.lang.StringUtils; public class substr{ public static void main(String[] args) { String str = “1234567890ABCDEFG”; System. Out. Println (“———–” + str.substring (0)); // intercept from the string index of 0 to the end of the string System. Out. Println (“—— 1 ——” + str.substring (6,7)); // from index 6 to index 7 (index 7 is […]

  • [leetcode] 125. Verify palindrome string

    Time:2020-4-6

    subject Given a string, verify whether it is a palindrome string, only consider alphabetic and numeric characters, and ignore the case of letters. In this paper, we define an empty string as a valid palindrome string. Example 1: Input: “a man, a plan, a canal: Panama” Output: true Example 2: Type: “race a car” Output: […]

  • Angularjs uses promise

    Time:2020-4-5

    How to use promise in angularjs Must be inAngularJSUse inPromiseTo useAngularJSBuilt in services for$q。 We can use it first$qOfdefer()Method to create adeferredObject, and then pass thedeferredObjectpromiseProperty to change this object into apromiseObject; thisdeferredObject also provides three methods, namelyresolve(), reject(), notify()。 HTML Code: <!DOCTYPE html> <html lang=”en”> <head> <title>demo</title> <meta charset=”UTF-8″> <meta name=”viewport” content=”width=device-width, initial-scale=1″> </head> […]

  • Flask query whois information instance

    Time:2020-4-4

    The basic implementation of flask will not be described in detail. Students who don’t know can learn from official documentshttp://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iii-web-forms Step 1 create a new form class to query whois information Add the following code to forms.py: # -*- coding: utf-8 -*- from flask.ext.wtf import Form from wtforms import StringField from wtforms.validators import DataRequired class […]

  • Shell syntax

    Time:2020-4-4

    variable Declare, use, read only, delete myUrl=”runoob.com” echo $myUrl ${myUrl} readonly myUrl unset myUrl 1. When defining variables, do not add$, between variable name and equal signNo spaces2. Using variables, precede the variable name with$ 。3、{ }Optional, with or without braces to help the interpreter identify the boundary of variables4、unsetCommand, cannot delete read-only variables String […]

  • Casts and implicit conversions of data types

    Time:2020-4-3

    Classification of data types Classification of data types:Basic data typeandReference data type Coercive transformation Coercion mainly refers to the use of some specific functions to manually convert various types of values to their corresponding types. Number() UseNumber()Function, you can convert any type of value to a numeric value. There will be different results depending on […]

  • String function of SQL server system function

    Time:2020-4-3

    1、 String function Parameter character Ou expression: an alphanumeric expression composed of character data, which can be a constant or variable, a character column or a binary data column Parameter integer Ou expression: is a positive integer, and returns an empty string if integer Ou expression is negative 1. Substring(): intercept the specified string –In […]

  • Basic knowledge of lua

    Time:2020-4-2

    Preface Lua is a dynamic type language. Variables do not need to be type defined, but only need to be assigned values. global variable global variable By default, variables are always considered global. The global variable does not need to be declared. After assigning a value to a variable, the global variable is created. Accessing […]

  • Groovy core (1): string, set, operator overloading

    Time:2020-4-1

    Blog Homepage Groovy is the only scripting language to enhance the Java platform; compared with Java, scripting language has a better representation ability and can provide a higher level of abstraction.Groovy language features: Groovy is an object-oriented scripting language, and all things involved are objects, which is not like Java language Groovy and Java are […]

  • Java personnel’s attention accumulation in learning Python

    Time:2020-4-1

    data structure Series grammar Tool class String formatting

  • JS determines whether it is an IE browser and gives the IE version

    Time:2020-4-1

    No nonsense, just go to the code. For details, please refer to the code notes function IEVersion() { Var useragent = navigator. Useragent; // get the useragent string of the browser Var ISIE = useragent. Indexof (“compatible”) > 1 & & useragent. Indexof (“MSIE”) > 1; // judge whether ie < 11 browser Var isedge […]

  • On the small pit encountered by angularjs

    Time:2020-4-1

    For a recent project, it should be a simple input box to verify the IP address. Null value is allowed The first is to check whether the IP address matches correctly. At first, I wrote this in the instruction. After I input the blank space, I will prompt that the input is wrong, but there […]