Spin symbols

  • Автор темы Автор темы lokiys
  • Дата начала Дата начала
You can use switch for this case. Generate number 1-3 and depends on the number add to variable necessary data.
 
  • Спасибо
Реакции: СТЕПАН
You can use switch for this case. Generate number 1-3 and depends on the number add to variable necessary data.

If we talking about workaround then there is ready made version of this.

JavaScript:
Развернуть Свернуть Копировать
Random r = new Random( );
int dash = r.Next(1, 4);
var dash1 = string.Concat(Enumerable.Repeat("-", dash));
return dash1;

Cheers
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)