TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Freddy Abreu
NA
40
9.4k
String to numbers C#
May 6 2013 11:18 AM
Hi, my logic is really disappointing sometimes, so I'm doing this very basic program, when I write a "Name" the string could be replace by numbers please a I need help.
Here you are.
public
static
void
Main
(
string
[] args)
{
int
[] Numeros ={
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
};
string
[] Strcadena = {
"a"
,
"b"
,
"c"
,
"d"
,
"e"
,
"f"
,
"g"
,
"h"
,
"i"
,
"j"
,
"k"
,
"l"
,
"m"
,
"n"
,
"o"
,
"p"
,
"q"
,
"r"
,
"s"
,
"t"
,
"v"
,
"u"
,
"w"
,
"y"
,
"x"
,
"z"
};
string
Nombre =
string
.Empty;
Nombre = Console.
ReadLine
();
if
(Nombre.
Contains
(Strcadena[
0
]) ||
Nombre.
Contains
(Strcadena[
1
]) ||
Nombre.
Contains
(Strcadena[
2
]) ||
Nombre.
Contains
(Strcadena[
3
]) ||
Nombre.
Contains
(Strcadena[
4
]) ||
Nombre.
Contains
(Strcadena[
5
]) ||
Nombre.
Contains
(Strcadena[
6
]) ||
Nombre.
Contains
(Strcadena[
7
]) ||
Nombre.
Contains
(Strcadena[
8
]) ||
Nombre.
Contains
(Strcadena[
9
]) ||
Nombre.
Contains
(Strcadena[
10
]) ||
Nombre.
Contains
(Strcadena[
11
]) ||
Nombre.
Contains
(Strcadena[
12
]) ||
Nombre.
Contains
(Strcadena[
13
]) ||
Nombre.
Contains
(Strcadena[
14
]) ||
Nombre.
Contains
(Strcadena[
15
]) ||
Nombre.
Contains
(Strcadena[
16
]) ||
Nombre.
Contains
(Strcadena[
17
]) ||
Nombre.
Contains
(Strcadena[
18
]) ||
Nombre.
Contains
(Strcadena[
19
]) ||
Nombre.
Contains
(Strcadena[
20
]) ||
Nombre.
Contains
(Strcadena[
21
]) ||
Nombre.
Contains
(Strcadena[
22
]) ||
Nombre.
Contains
(Strcadena[
23
]) ||
Nombre.
Contains
(Strcadena[
24
]) ||
Nombre.
Contains
(Strcadena[
25
]) ||
Nombre.
Contains
(Strcadena[
2
]))
{
foreach
(
var
x
in
Numeros) {
Console.
WriteLine
(x);
}
}
Console.
ReadKey
(
true
);
}
}
}
Reply
Answers (
2
)
make windows app a dll
I have a problem in c #