Options
All
  • Public
  • Public/Protected
  • All
Menu

StringConverter Class Takes a string and converts it to an array of Digit objects

import { StringConverter } from '@maximva/examenopdracht-maximva'
const stringToDigits: StringConverter = new StringConverter
const temperature = "23.25 °C"
const digits: Digit[] =  stringToDigits.getDigits(temperature)

Hierarchy

  • StringConverter

Index

Methods

convertCharToDigit

  • convertCharToDigit(character: string): Digit
  • Converts a single character to a single Digit object

    Parameters

    • character: string

      The character to convert to a Digit object

    Returns Digit

getDigits

  • getDigits(temperature: string): Digit[]
  • Takes in the temperature in a string format and returns a Digit object for every character in the string

    Parameters

    • temperature: string

      The temperature in string format to convert to Digits

    Returns Digit[]

Generated using TypeDoc