Issue

  • Thread starter sridhartv25@gmail.com
  • Start date
S

sridhartv25@gmail.com

Guest
Hello all,
I have a issue,
I am using this

strcat("mail2->" strcat("s" sprintf(nil "%L" 1)) "->value")
gives me the result
"mail2->s1->value"

How can I convert "mail2->s1->value" to mail2->s1->value.

And the second question is how can I remove \ character from a string.
(If possible by using rexCompile.)
Suppose I have
a="Sri\dhar"
I want it to be "Sridhar".

Regards,
Sridhar.
 
use evalstring

automatically removes "\" if it is not meaningful. If it is
meaningful, you can not do it.

On Jun 23, 3:46 pm, "sridhart...@gmail.com" <sridhart...@gmail.com>
wrote:
Hello all,
I have a issue,
I am using this

strcat("mail2->" strcat("s" sprintf(nil "%L" 1)) "->value")
gives me the result
"mail2->s1->value"

How can I convert "mail2->s1->value" to mail2->s1->value.

And the second question is how can I remove \ character from a string.
(If possible by using rexCompile.)
Suppose I have
a="Sri\dhar"
I want it to be "Sridhar".

Regards,
Sridhar.
 
sridhartv25@gmail.com wrote, on 06/23/09 11:46:
Hello all,
I have a issue,
I am using this

strcat("mail2->" strcat("s" sprintf(nil "%L" 1)) "->value")
gives me the result
"mail2->s1->value"

How can I convert "mail2->s1->value" to mail2->s1->value.

And the second question is how can I remove \ character from a string.
(If possible by using rexCompile.)
Suppose I have
a="Sri\dhar"
I want it to be "Sridhar".

Regards,
Sridhar.
Doing it this way is bad. You should use:

n=1
get(mail2 concat('s n))->value

No need to use evalstring(). The get() function allows you to give the name of
the symbol as a variable.

If you try:

a="Sri\dhar"

you'll get:

PARSER WARNING at line 14 column 12 of file *stdin*
*WARNING* (Parser): character found after backslash is not meaningful - Sri\dhar
"Sridhar"

because \d doesn't mean anything in SKILL. \ is an escape character.

If you'd done:

a="Sri\\dhar"

that would mean you actually have an "\" in the string. You can get rid of it by
doing:

rexCompile("\\\\")
rexReplace(a "" 0)

The reason why you need four \ in the rexCompile is because \ means something
special to SKILL, and it means something special in regular expressions. So \\\\
becomes \\ really, and that is regular-expression speak for "\" (I know,
crazy, isn't it?).

Andrew.
 
Thanks Andrew and Rajes for your kind replies,

Yes andrew I could solve my issue by using the get function ,
Basically I want to convert "mail2->s1->value" to mail2->s1->value
so that I can assign a value to this,and could be solved by the get
function.

Regards,
Sridhar.
 

Welcome to EDABoard.com

Sponsor

Back
Top