How to get the length of a number or string value?

(imported topic written by SystemAdmin)

Hello all

how can i write a relevance to get the length of a string or numeric value

for example

length ( “speak” ) = 5

length (555555) = 6

Thanks

Ahmed Hamed

(imported comment written by Steve91)

Q: length of “hello”

A: 5

Q: length of “xc12354”

A: 7

Cheers

Steve

(imported comment written by SystemAdmin)

:slight_smile:

thanks alot , i was sure that it is something very trivial !

(imported comment written by Shembop91)

How about a length of a value of a registry key?

(imported comment written by Lee Wei)

The important note is that a Registry Key Value is not a string, so you cannot use the “length” operator until you have converted it into one.

There are 2 forms as examples below.

q: value "InstallRoot" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework" of registry
A: C:\Windows\Microsoft.NET\Framework\
 
q: length of (it as string) of value "InstallRoot" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework" of registry
A: 35
 
q: length of (value "InstallRoot" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework" of registry as string)

Lee Wei