String Derived Types

Internet object specifies email, url, datetime, date and time as derived types of string and also provides built-in support for them.

The following snippet represents a string and its derived types.

# Strings and its derived types
{ 
  name: string, 
  emailId: email, 
  profileUrl: url,
  journyDate: date,
  departureTime: time,
  bookingDatetime: datetime
   
 }
---
{ 
 Christopher Andrews,                                # string
 [email protected],                      # email
 https://www.abc.com/in/christopher-andrew-06528b155 #url
 2021-02-09                                          # date
 06:30:00                                            # time
 2020-12-30T12:39:48.545                             #datetime
}
  

Here the, name is of string type and will only accept strings. Similarly, emailId, profileUrl, journyDate departureTime and bookingDatetimedate are of different types such as email, url, date, time, datetime. Therefore they will only accept values with the defined types for the respective variable.

Last updated