C # study notes II (Stack, Queue, String, Hashtable, StringBuilder, Regular Express)

zhaozj2021-02-16  52

Queue:

Enqueue ()

Dequeue ()

PEEK () // Only Get First Element, Not Delete IT

Stack:

Count ()

Clear ()

PEEK ()

POP ()

Push ()

COPYTO (Array, Offset) // Copy TO Array

Dictionary / havehtable:

Keys // Collection of Keys,

VALUES // Collection of Value

Count ()

Clear ()

Contains () // is Element in Hashtable

Containskey () // is key in hashtable

Item () // Indexer for Hashtable

Add () // Add entry with key / value

GetENUMERATOR () // CREAT and RETURN A Enumator Object

Strings:

String

Compare () split ()

Concat () StartSwith ()

Equals () TOLOWER () / TouPper ()

INSERT () TRIM ()

Format ()

String.comPare (S1, S2); // Case Sensitive

String.comPare (S1, S2, TRUE) // Case Not Sensitive

String S3 = @ "test / .net"

String S6 String.copy (S5);

String S7 = S6

S7 == S6

S7.Equals (S6)

String.equals (S7, S6)

S7.LENGTH

S3.Endwith ("test")

INT offset = s3.indexof ("test") // first occurence

String S10 = S3.INSERT (Offset, "DDD");

String S11 = S3.INSERT (S3.Indexof ("DDD"), "EEE");

S12.SPLIT (DELIMITERS)

Regex r = new regex ("|,");

FOREACH (STRING S IN R.SPLIT (S12)) {}

StringBuilder StringBuilder SB = new stringbuild ();

Append ()

Tostring ()

Regular Expresss:

Using system.text.regularExpressions;

转载请注明原文地址:https://www.9cbs.com/read-24454.html

New Post(0)