String comparison in beshe can be from the beginning found as difficult because it has many rules such
as when to score marks and to double brackets.
In addition some scripts using double square brackets are not.
So generally when you don't know what is going on here you may feel kind of lost but I need to tell
you that string comparison is quite easy when you know the rules.
In fact I believe that by end of this lecture you say OK it's quite simple.
So let's look how to compare two strings.
For string comparison we are using single square brackets and inside it.
Dollar sign for is the variable equal sign or sign second variable.
Those two variables are inside double quotation marks.
Similarly you can compare a variable with some string.
In our case which string how it is really important to not forget on spaces Otherwise you will have
problem running that comparison.
It may feel strange to put spaces next to brackets and variables especially if you know some other programming
language where a condition of writing is not space sensitive but by creating scripts and practicing
you quickly get used to it.
We said that for string comparison we are using a variable name inside double quotation mark why we
do that because if you don't do that and some string is not defined or empty you get an error message
which would lead to not properly working script.
But in beshe there is a way how to not use double quotation marks.
It is by using double square brackets.
And should be mention that this is not vitally whilst most people are using single square brackets and
double quotation marks around variables but the board ways are correct and it is up to you would you
prefer.
Also if you use double square brackets you can also use quotation marks around the variables.
There is no issue with that.
Only you would get slightly larger called.
We can also test if a string is empty by using dataset or an open and when using Desch is that it is
written through if string is empty.
When we use Desch M it is written through in a case that string is not empty.
And of course as for comparing two strings we can use double square brackets instead of single and in
such case we don't need to have double quotation marks around variables.
It is again up to you what do you prefer.
Mostly it is use single square to break it with the double quotation marks around var..
We can also alphabetically compare two strings if you want to compare alphabetically.
We need to use doubles square brackets.
You don't have a choice between double and single square brackets.
For string comparison we are also using a wildcard in regular expressions but those two techniques are
quite complex.
So I will tell you more about them in separate lecture.
Now we see that for string comparison there are some rules which might seem complicated.
The best way how to remember them is to practice.
So let's write some script to see it in action.