String manipulation and query functions.
concat( strings, ... )
s1+s2+...
, but this method makes sure that
values are converted to strings, with the blank value invisible.strings
(Object, one or more): one or more stringsjoin( separator, words, ... )
separator
(String): string to insert between adjacent wordswords
(Object, one or more): one or more values to joinseparator
equals( s1, s2 )
s1==s2
,
which can (for technical reasons) return false even if the
strings are the same.s1
(String): first strings2
(String): second stringequalsIgnoreCase( s1, s2 )
s1
(String): first strings2
(String): second stringstartsWith( whole, start )
whole
(String): the string to teststart
(String): the sequence that may appear at the start of
whole
whole
are
the same as start
endsWith( whole, end )
whole
(String): the string to testend
(String): the sequence that may appear at the end of
whole
whole
are
the same as end
contains( whole, sub )
whole
(String): the string to testsub
(String): the sequence that may appear within whole
sub
appears within
whole
length( str )
str
(String): stringstr
split( words )
The result is an array of strings, and if you want to use the
individual elements you need to use square-bracket indexing,
with [0]
representing the first object
words
(String): string with embedded spaces delimiting the wordssplit( words, regex )
The result is an array of strings, and if you want to use the
individual elements you need to use square-bracket indexing,
with [0]
representing the first object
words
(String): string with multiple partsregex
(String): regular expression delimiting the different words in
the words
parametermatches( str, regex )
str
(String): string to testregex
(String): regular expression stringregex
matches str
anywherematchGroup( str, regex )
str
(String): string to match againstregex
(String): regular expression containing a grouped sectionregex
didn't match str
)replaceFirst( str, regex, replacement )
str
(String): string to manipulateregex
(String): regular expression to match in str
replacement
(String): replacement stringstr
, but with the first match (if any) of
regex
replaced by replacement
replaceAll( str, regex, replacement )
str
(String): string to manipulateregex
(String): regular expression to match in str
replacement
(String): replacement stringstr
, but with all matches of
regex
replaced by replacement
substring( str, startIndex )
str
(String): the input stringstartIndex
(integer): the beginning index, inclusivestr
, omitting the first
startIndex
characterssubstring( str, startIndex, endIndex )
startIndex
and continues to the character at index endIndex-1
Thus the length of the substring is endIndex-startIndex
.str
(String): the input stringstartIndex
(integer): the beginning index, inclusiveendIndex
(integer): the end index, inclusivestr
toUpperCase( str )
str
(String): input stringstr
toLowerCase( str )
str
(String): input stringstr
trim( str )
str
(String): input stringpadWithZeros( value, ndigit )
value
(long integer): numeric value to padndigit
(integer): the number of digits in the resulting stringvalue
with
at least ndigit
charactersdesigToRa( designation )
2MASS J04355524+1630331
"
following the specifications in the document
http://cds.u-strasbg.fr/vizier/Dic/iau-spec.htx.
Note: this function should be used with considerable care. Such designators are intended for object identification and not for communicating sky positions, so that the resulting positions are likely to lack precision, and may be inaccurate. If positional information is available from other sources, it should almost certainly be used instead. But if there's no other choice, this may be used as a fallback.
Note also
that a designator with no coordsystem-specific flag character
(a leading "J
", "B
" or "G
")
is considered to be B1950, not J2000.
designation
(String): designation string in IAU formatdesigToDec( designation )
2MASS J04355524+1630331
"
following the specifications in the document
http://cds.u-strasbg.fr/vizier/Dic/iau-spec.htx.
Note: this function should be used with considerable care. Such designators are intended for object identification and not for communicating sky positions, so that the resulting positions are likely to lack precision, and may be inaccurate. If positional information is available from other sources, it should almost certainly be used instead. But if there's no other choice, this may be used as a fallback.
Note also
that a designator with no coordsystem-specific flag character
(a leading "J
", "B
" or "G
")
is considered to be B1950, not J2000.
designation
(String): designation string in IAU formatdesigToIcrs( designation )
2MASS J04355524+1630331
"
to determine its sky position,
following the specifications in the document
http://cds.u-strasbg.fr/vizier/Dic/iau-spec.htx.
Obviously, this only works where the sequence part of the designation takes one of the family of coordinate-based forms.
Note: this function should be used with considerable care. Such designators are intended for object identification and not for communicating sky positions, so that the resulting positions are likely to lack precision, and may be inaccurate. If positional information is available from other sources, it should almost certainly be used instead. But if there's no other choice, this may be used as a fallback.
Note also
that a designator with no coordsystem-specific flag character
(a leading "J
", "B
" or "G
")
is considered to be B1950, not J2000.
designation
(String): designation string in IAU formatnull
if no position can be decoded