public function toOffset(string $content): int
    {
        $lines = explode("\n", $content);
        $slice = array_slice($lines, 0, $this->line);
        return (int) array_sum(array_map('strlen', $slice)) + count($slice) + $this->character;
    }
public function toOffset(string $content): int
    {
        $lines = explode("\n", $content);
        $slice = array_slice($lines, 0, $this->line);
        return (int) array_sum(array_map('strlen', $slice)) + count($slice) + $this->character;
    }
public function toOffset ( string $ content ) : int { $ lines = explode ( "\n" , $ content ) ; $ slice = array_slice ( $ lines , 0 , $ this -> line ) ; return ( int ) array_sum ( array_map ( 'strlen' , $ slice ) ) + count ( $ slice ) + $ this -> character ; }
Returns the offset of the position in a string

@param string $content
@return int
Returns the offset of the position in a string