Error with a string

(imported topic written by schmucke91)

Hi I have the following problem

I am working with a string

substring (18.14) of “User Name: Esna” and shows me the following error

Error: Singular expression referees to nonexistent object.

but if I put the following:

substring (18.14) of “User Name: Esna Alfonzo”

pays off

Alfonzo Esna

who can help me?

(imported comment written by NoahSalzman)

The first number is the position in the string (starting at position 0) and the second number is the number of characters you want returned.

Q: substring (0,12) of “User Name: Esna Alfonzo”

A: User Name: E

I’m not sure how you got (18.14) to work, I assume that is an error in your example.

Q: substring (11,12) of “User Name: Esna Alfonzo”

A: Esna Alfonzo

The error “nonexistent object” simply means “you asked the Relevance engine to look for something and it wasn’t there”. For example:

Q: substring (12,12) of “User Name: Esna Alfonzo”

E: Singular expression refers to nonexistent object.

That translates as "give me 12 characters starting from the “s” in Esna. Well, the second “o” in Alfonzo is the 11th character, so we are asking the engine to return something that does not exist, and it properly complains, letting us know that there is no 12 character string starting from the “s”.

What problem are you trying to solve? If you just want the characters after the “:” – and you don’t know how long the string will be – you can do something like this:

Q: following texts of first “:” of “User Name: Esna Alfonzo” as trimmed string

A: Esna Alfonzo

Note to 7.x users: the substring (x,y) operator was introduced in v8.0

(imported comment written by schmucke91)

thanks