util.isString(obj)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Returns true if the obj parameter is a JavaScript String object or primitive, and false otherwise

Returns

boolean

Supported Script Types

Client and server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/util Module

Since

2016.1

Parameters

Parameter

Type

Required / Optional

Description

Since

obj

Object | Primitive

required

Object for which you want to verify the type.

2016.1

Syntax
Important:

The following code snippet shows the syntax for this member. It is not a functional example. For a full script sample, see N/util Module Script Sample.

          //Add additional code 
...
util.isString('');                            // returns true
util.isString('a string');                    // returns true

var myString = new String('another string');
util.isString(myString);                      // returns true

util.isString(null);                          // returns false
...
//Add additional code 

        

Related Topics

N/util Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices