[SOLVED] Trim characters/text down?

shabbysquire

Client
Регистрация
25.11.2012
Сообщения
544
Реакции
26
Баллы
28
Hey all.

Is is possible to trim some text that's assigned to a variable?

I'm looking at word processing but can't find a way to trim some text down, i.e. from 100 characters to only 30.
 
This works ok if in action word processing > substring and i put: 0 - 170. It trims anything over 170 characters ok, but if a variable has, say, 150 characters, ZP comes up with an error: Failed to process text.
 
Is there a way to use C# for this like the following? I tried but it failed.

return project.Variables["yourVariableName"].Substring(0,Math.Min(30, project.Variables["yourVariableName"].Length))
 
Код:
Развернуть Свернуть Копировать
return project.Variables["yourVariableName"].Value.Substring(0,Math.Min(30, project.Variables["yourVariableName"].Value.Length)) ;
 
  • Спасибо
Реакции: KitKat21
Thank you very much.
 

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