"string" "subtraction" Operation

This section describes 'string' 'subtraction' operation

The "string" "subtraction" operation is provided through the string.subtract() function, which has the following syntax:

string.subtract(a, b)

Parameters:
   a - First "string" data object
   b - Second "string" data object
   
Return: 
   Returns a new "string" data object representing 
   the remaining of the first string with the second string removed.

The "string" "subtraction" operation can be expressed in the "-" operator format:

a - b; # alias of the following function call
string.subtract(a, b); 

Examples of how to use string.subtract() operation:

"banana" - "a"; # the result is "bnn"
"banana" - "o"; # the result is "banana"

Last update: 2017.

Table of Contents

 About This Book

 Introduction of H Language

 Syntax

 Data Types

 Variables

 Expressions

 Statements

 "boolean" Data Type

 "integer" Data Type

"string" Data Type

 What Is "string" Data Type

 "string" Literals

 Escape Sequences in "string" Literals

 Escape Sequences for Non-Printable ASCII Characters

 Escape Sequences for Unicode Characters

 String Literals with Line Breaks

 String Literals Continuing on Next Lines

 Expression Interpolation in String Literals

 String Literals with No Escape Sequences

 Constructor Function: string()

 string.get() - Retrieve Character from String

 x[i] - Array Element Format for string.get()

 string.set() - Update Character to String

 x[i] - Array Element Format for string.set()

 "string" "add" Operation

"string" "subtraction" Operation

 "string" "multiplication" Operation

 "string" "division" Operation

 "string" "modulo" Operation

 string.length() Function

 "real" Data Type

 "array" Data Type

 Source Code Packages

 Classes and Objects

 Object Oriented Programming

 Inheritance - Object Attachments

 Encapsulation - Private Members

 References

 PDF Printing Version