Skip to content

Latest commit

 

History

History
107 lines (78 loc) · 1.77 KB

String.md

File metadata and controls

107 lines (78 loc) · 1.77 KB

String

Kuifje support for strings.


String Constructor

The way to create a string in kuifje follows.

x = "value";

And its output of the variable "x" is given below:

Probability of the distribution happen Distribution Value
1.00 1.00 "value"

String Comparison

Equals

Verifies if a value is equal to other.

Example

Program:

x = "right";
y = "wrong";
z = x == y;

Output of variable z:

Probability of the distribution happen Distribution Value
1.00 1.00 False

Not Equals

Verifies if a value is different of other.

Example

Program:

x = "right";
y = "wrong";
z = x != y;

Output of variable z:

Probability of the distribution happen Distribution Value
1.00 1.00 True

Is Sub String Of

This function takes two strings, returnings True if the characters of the first string occurs, in order, in the second. The characters do not have to be consecutively placed.

Example

Program:

x = "ali";
y = "valid";
z = x strIsSub y;

Output of variable z:

Probability of the distribution happen Distribution Value
1.00 1.00 True

Program:

x = "ai";
y = "valid";
z = x strIsSub y;

Output of variable z:

Probability of the distribution happen Distribution Value
1.00 1.00 True

Program:

x = "ia";
y = "valid";
z = x strIsSub y;

Output of variable z:

Probability of the distribution happen Distribution Value
1.00 1.00 False

Summary