Tutorial by Examples: bst

Const baseString As String = "Foo Bar" Dim containsBar As Boolean 'Check if baseString contains "bar" (case insensitive) containsBar = InStr(1, baseString, "bar", vbTextCompare) > 0 'containsBar = True 'Check if baseString contains bar (case insensitive) co...
Const baseString As String = "Foo Bar" Dim containsBar As Boolean Dim posB As Long posB = InStr(1, baseString, "B", vbBinaryCompare) 'posB = 5
Const baseString As String = "Foo Bar" Dim containsBar As Boolean 'Find the position of the last "B" Dim posX As Long 'Note the different number and order of the paramters for InStrRev posX = InStrRev(baseString, "X", -1, vbBinaryCompare) 'posX = 0
SUBSTR retrieves part of a string by indicating the starting position and the number of characters to extract SELECT SUBSTR('abcdefg',2,3) FROM DUAL; returns: bcd To count from the end of the string, SUBSTR accepts a negative number as the second parameter, e.g. SELECT SUBSTR('abcdefg',-4,2...
If classes share common functionality you can group this in a base or abstract class. Abstract classes can contain partial or no implementation at all and allow the derived type to override the base implementation. Abstract classes within VisualBasic.NET must be declared as MustInherit and cannot ...
This command: :s/foo/bar/g substitutes each occurrence of foo with bar on the current line. fool around with a foodie becomes barl around with a bardie If you leave off the last /g, it will only replace the first occurence on the line. For example, :s/foo/bar On the previous line wou...
perl -pe"s/foo/bar/g" file.txt Or in-place: perl -i -pe's/foo/bar/g' file.txt On Windows: perl -i.bak -pe"s/foo/bar/g" file.txt
Unlike other programming languages, in a batch file a variable is substituted by its actual value before the batch script is run. In other words, the substitution is made when the script is read into memory by the command processor, not when the script is later run. This enables the use of variable...
When to use abstract classes: To implement the same or different behaviour among multiple related objects When to use interfaces: to implement a contract by multiple unrelated objects Abstract classes create "is a" relations while interfaces provide "has a" capability. This c...
SUB function allows to substitute text inside awk sub(regexp, replacement, target) where regexp could be a full regular expression $ cat file AAAAA BBBB CCCC DDDD EEEE FFFF GGGG $ awk '{sub("AAA","XXX", $0); print}' file XXXAA BBBB CCCC DDDD EEEE FFFF GGGG ...
p "This is %s" % "foo" # => "This is foo" p "%s %s %s" % ["foo", "bar", "baz"] # => "foo bar baz" p "%{foo} == %{foo}" % {:foo => "foo" } # => "foo == foo" See String...
Returns a substring that starts with the char that's in the specified start index and the specified max length. Parameters: Character expression. The character expression can be of any data type that can be implicitly converted to varchar or nvarchar, except for text or ntext. Start index. A nu...
abstract class Machine { constructor(public manufacturer: string) { } // An abstract class can define methods of it's own, or... summary(): string { return `${this.manufacturer} makes this machine.`; } // Require inheriting classes to implement methods ...
The following abstract defines an EmailAddress type based on the String type which will use a regular expression to validate the passed argument as an e-mail address. If the address isn't valid, an exception will be thrown. abstract EmailAddress(String) { static var ereg = ~/^[\w-\.]{2,}@[\w-\.]...
For efficiency, Prolog code is typically compiled to abstract machine code before it is run. Many different abstract machine architectures and variants have been proposed for efficient execution of Prolog programs. These include: WAM, the Warren Abstract Machine TOAM, an abstract machine used i...
Abstraction is a process of hiding the implementation details and showing only functionality to the user. An abstract class can never be instantiated. If a class is declared as abstract then the sole purpose is for the class to be extended. abstract class Car { abstract void tagLine(); } ...
$ mplayer Lecture_video_part1.mkv $ ^1^2^ mplayer Lecture_video_part2.mkv This command will replace 1 with 2 in the previously executed command. It will only replace the first occurrence of the string and is equivalent to !!:s/1/2/. If you want to replace all occurrences, you have to use !!:gs...
SUBSTRING (or equivalent: SUBSTR) returns the substring starting from the specified position and, optionally, with the specified length Syntax: SUBSTRING(str, start_position) SELECT SUBSTRING('foobarbaz', 4); -- 'barbaz' SELECT SUBSTRING('foobarbaz' FROM 4); -- 'barbaz' -- using negative index...
Rather than passing a static string as a predicate's criteria. It is possible to substitute values by using format specifiers. There are five format specifiers: %K is a var arg substitution for a key path. %@ is a var arg substitution for an object value-often a string, number, date, or an array...
The Abstract Factory Pattern is a creational design pattern that can be used to define specific instances or classes without having to specify the exact object that is being created. function Car() { this.name = "Car"; this.wheels = 4; } function Truck() { this.name = "Truck"; ...

Page 3 of 5