English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

how can i compare a string to another string if they are equal or have the same characters or not?

2007-09-04 01:21:17 · 6 answers · asked by fatal_phan2m_21 1 in Computers & Internet Programming & Design

6 answers

That depends on the programming language you are using.

It could be

"foo" eq "foo"

or

"foo" == "foo"

or

"foo".compare("foo")

or something else.

2007-09-04 01:28:30 · answer #1 · answered by David D 7 · 2 0

In Java
if(string1.equals(string2)) {
something
}

2007-09-04 01:28:25 · answer #2 · answered by AnalProgrammer 7 · 1 0

use the strcmp() function which is in string.h header file.
use strlen() for finding the length of the both string which is also in string.h header file

2007-09-04 01:36:33 · answer #3 · answered by veerranjan 1 · 1 0

Char by char

2007-09-04 01:29:44 · answer #4 · answered by Anonymous · 1 0

IN WHICH LANGUAGE
==================

in C you have strcmp and stricmp.

You have to be more specific.

2007-09-04 01:28:25 · answer #5 · answered by Anonymous · 2 0

if (string1 == string2)
{
;
}

2007-09-04 04:53:10 · answer #6 · answered by The Master 5 · 0 0

fedest.com, questions and answers