
- Erlang Tutorial
- Erlang - Home
- Erlang - Overview
- Erlang - Environment
- Erlang - Basic Syntax
- Erlang - Shell
- Erlang - Data Types
- Erlang - Variables
- Erlang - Operators
- Erlang - Loops
- Erlang - Decision Making
- Erlang - Functions
- Erlang - Modules
- Erlang - Recursion
- Erlang - Numbers
- Erlang - Strings
- Erlang - Lists
- Erlang - File I/O
- Erlang - Atoms
- Erlang - Maps
- Erlang - Tuples
- Erlang - Records
- Erlang - Exceptions
- Erlang - Macros
- Erlang - Header Files
- Erlang - Preprocessors
- Erlang - Pattern Matching
- Erlang - Guards
- Erlang - BIFS
- Erlang - Binaries
- Erlang - Funs
- Erlang - Processes
- Erlang - Emails
- Erlang - Databases
- Erlang - Ports
- Erlang - Distributed Programming
- Erlang - OTP
- Erlang - Concurrency
- Erlang - Performance
- Erlang - Drivers
- Erlang - Web Programming
- Erlang Useful Resources
- Erlang - Quick Guide
- Erlang - Useful Resources
- Erlang - Discussion
Erlang - equal
The method returns a Boolean value on whether one string is equal to another. If the strings are equal, it will return a value of true, else it will return a value of false.
Syntax
equal(str1,str2)
Parameters
str1,str2 − The 2 strings which need to be compared.
Return Value
If the 2 strings are equal, it will return a value of true, else it will return a false value.
For example
-module(helloworld). -import(string,[equal/2]). -export([start/0]). start() -> Str1 = "This is a string1", Str2 = "This is a string2", Status = equal(Str1,Str2), io:fwrite("~p~n",[Status]).
Output
When we run the above program, we will get the following result.
false
strings.htm
Advertisements