Retrieve line/column from 'index' of 'string'
Column is zero-indexed
@param {String} string
@param {Number} index
@returns {Object}
778315
function getLocationFromIndex(string, index) {
  const lines = string.split('\n');
  let destructure = false;
  let idx = 0;
  const results = [];
  let found = [];

  // Convert to batch
  if (!Array.isArray(index)) {
    index = [index];
    destructure = true;
  }

  for (let i = 0, l = lines.length; i < l; i++) {
    const m = index.length;
    const line = lines[i];
    // Add removed line ending
    const lineLength = line.length + 1;

    // Abort if no more indexes
    if (!m) break;

    // Loop through remaining indexes
    for (let j = 0; j < m; j++) {
      // Store result if index in current line
      if (idx + lineLength > index[j]) {
        results.push({
          line: i + 1,
          column: index[j] - idx
        });
        // Store matched index for later removal
        found.push(j);
      }
    }

    if (found.length) {
      for (let k = 0, n = found.length; k < n; k++) {
        // Remove index (correct for previous removals)
        index.splice(found[k] - k, 1);
      }
      found = [];
    }
    idx += lineLength;
  }

  if (results.length) return destructure ? results[0] : results;
  return { line: 0, column: 0 };
}
1109742
function GetColumnNameByIndex($index, $remove_prefix = true)
	{
		$count = 0;
		foreach ($this->Columns as $column)
		{
			if ($count == $index) return ($remove_prefix) ? $column->NameWithoutPrefix : $column->Name;
		}
		
		throw new Exception('Index out of bounds');
	}
1141416
function betterIndexOf(arr, value) {
    if (value != value || value === 0) { // eslint-disable-line eqeqeq
        var i = arr.length;
        while (i-- && !is(arr[i], value)) {
            // eslint-disable-line no-empty
        }
    } else {
        i = [].indexOf.call(arr, value);
    }
    return i;
}
664453
def translate_index_to_position(self, index):
        
        # Find start of this line.
        row, row_index = self._find_line_start_index(index)
        col = index - row_index

        return row, col
1298829
public String convertIndexToString(int index)
    {
        String tempString = null;
        if (index == 0)
            tempString = NO;
        else if (index == 1)
            tempString = YES;
        return tempString;
    }
738883
function(column){
			var index = -1;
			for(var i=0;i < this.gridCompColumnArr.length;i++){
				if(this.gridCompColumnArr[i] == column){
					index = i;
					break;
				}
			}
			return index;
		}
796428
@Override
    public String getString(int index) {
        check(index);
        final Object obj = fleeceValueToObject(index);
        return obj instanceof String ? (String) obj : null;
    }
531641
public function column($index = 0)
    {
        $stmt = $this->execute();

        if ($stmt) {
            return $stmt->fetchAll(PDO::FETCH_COLUMN, $index);
        } else {
            return false;
        }
    }
297539
function(str){
    var lines = str.match(/\n/g)
      , idx = str.lastIndexOf('\n');

    if (lines) this.lineno += lines.length;
    this.column = ~idx
      ? str.length - idx
      : this.column + str.length;
  }
896967
public String convertIndexToDisStr(int index)
    {
        if (index == CalendarEntry.ANNIVERSARY_ID)
            return ANNIVERSARY;
        if (index == CalendarEntry.APPOINTMENT_ID)
            return APPOINTMENT;
        return null;
    }
549200
public String convertIndexToDisStr(int index)
    {
        int iErrorCode = this.moveToIndex(index);
        if (iErrorCode == DBConstants.NORMAL_RETURN)
        {
            if (displayFieldName != null)
                return m_record.getField(displayFieldName).getString();
            else
                return m_record.getField(m_iFieldSeq).getString();
        }
        else
            return Constants.BLANK;
    }
161915
public final String getColumnName(int index) {
        assert(verifyTableInvariants());
        if ((index < 0) || (index >= m_colCount)) {
            throw new IllegalArgumentException("Not a valid column index.");
        }

        // move to the start of the list of column names
        int pos = POS_COL_TYPES + m_colCount;
        String name = null;
        for (int i = 0; i < index; i++) {
            pos += m_buffer.getInt(pos) + 4;
        }
        name = readString(pos, METADATA_ENCODING);
        assert(name != null);

        assert(verifyTableInvariants());
        return name;
    }
579995
function(line) {
		var dataArray = [];
		var tempString="";
		var lineLength = line.length;
		var index=0;
		while(index<lineLength) {
			if(line[index]=='"') {
				var index2 = index+1;
				while(line[index2]!='"') {
					tempString+=line[index2];
					index2++;
				}
				dataArray.push(tempString);
				tempString = "";
				index = index2+2;
				continue;
			}
			if(line[index]!=",") {
				tempString += line[index];
				index++; continue;
			} 
			if(line[index]==",") {
				dataArray.push(tempString);
				tempString = "";
				index++;continue;
			}

		}
		dataArray.push(tempString);
		return dataArray;
	}
1279953
function (obj, count, index) {
    if (obj) {
      if (typeof index !== 'undefined') {
        return obj.columnLabel(index);
      }
      else {
        var headers = [];
        for (var i = 0; i < count; i++) {
          headers.push(obj.columnLabel(i));
        }
        return headers;
      }
    }
  }
236887
function getLeftEdge(index, cell) {
        return {
          index: index,
          x: editor.dom.getPos(cell).x
        };
      }
1127759
function(rowIndex) {
        if (typeof rowIndex !== 'undefined') {
            if ($.isArray(rowIndex)) {
                var result = [],
                    self = this;
                $.each(rowIndex, function(index, value) {
                    var item = self.options.data[value - 1];
                    if (item) {
                        result.push(item);
                    }
                });
                return result.length !== 0 ? result : null;
            } else {
                return this.options.data[rowIndex - 1] || null;
            }
        } else {
            return this.options.data;
        }
    }
1265604
function getIndexOf(array, value, fromIndex) {
    var result = (result = lodash.indexOf) === indexOf ? basicIndexOf : result;
    return result;
  }