Questions about C#
 |
|
 |
| |
Bad.boy!  |
|
SA modder

Group: Members
Joined: Jun 20, 2010


|
Does anyone know how to make global strings in C#? I know you can make something like this: | CODE | public static class Globals { public const string FCarcol = "example"; } |
But that doesn't allow me to write something new. And how to break up a string like this in seperate parts: | CODE | | supergt, supergt, car, SUPERGT, SUPER, VEH@LOW, VEH@LOW_INFERNUS, 100, 999, 0.2286, 0.2286, 0, 2, 1.0 ,0, - | This post has been edited by Bad.boy! on Tuesday, Apr 10 2012, 08:47
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
vincelegard  |
|
Player Hater

Group: Members
Joined: Jun 24, 2012

|
split function //declare a string array string[] strArr = null; str = "upergt, supergt, car, SUPERGT, SUPER, VEH@LOW, VEH@LOW_INFERNUS, 100, 999, 0.2286, 0.2286, 0, 2, 1.0 ,0, -" char[] splitchar = { ',' }; strArr = str.Split(splitchar); from strArr you can retrieve each string source : http://csharp.net-informations.com/string/...tring-split.htmlegard.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|