Splits a line at the first occurrence of :

@param  {string} line
@return {Array.<string>}
@private
987
function splitLine(line) {
	var idx = String(line).indexOf(':');

	if (!line || idx < 0) {
		return null;
	}

	return [line.slice(0, idx), line.slice(idx + 1)];
}
528447
protected function splitLine($line)
    {
        $result = [];
        foreach($this->fields as $field) {
            $result[] = mb_substr($line, $field['from'], $field['to'] - $field['from']);
        }
        return $result;
    }
69711
function parseLine(line) {
	let origin = null;
	let command = null;
	const args = [];
	if (line.length === 0) {
		// empty line is not valid
		return null;
	}
	let spaceAt;
	// first, parse the origin (if any)
	if (line.charAt(0) === ':') {
		spaceAt = line.indexOf(' ');
		if (spaceAt !== -1) {
			origin = line.substring(1, spaceAt);
			line = line.substring(spaceAt + 1);
		} else {
			// one word that starts with a : is not valid
			return null;
		}
	}
	if (line.length === 0) {
		// no command? invalid line
		return null;
	}
	// second, parse the command
	spaceAt = line.indexOf(' ');
	if (spaceAt !== -1) {
		command = line.substr(0, spaceAt);
		line = line.substring(spaceAt + 1);
	} else {
		command = line;
		line = null;
	}
	// now parse the args
	while (line !== null && line.length > 0) {
		if (line.charAt(0) === ':') {
			args.push(line.substring(1));
			line = null;
		} else {
			spaceAt = line.indexOf(' ');
			if (spaceAt !== -1) {
				args.push(line.substring(0, spaceAt));
				line = line.substring(spaceAt + 1);
			} else {
				args.push(line);
				line = null;
			}
		}
	}
	return {
		origin: origin,
		command: command,
		args: args
	};
}
430344
static function parse_line($line)
    {
        $line = trim($line);
        $result = array();
        $datas = explode(self::$col_sep, $line);
        if (empty(self::$data_sep))
        {
            return $datas;
        }
        foreach ($datas as $data)
        {
            $d = self::parse_data($data);
            if (empty($d[0]))
            {
                continue;
            }
            $result[trim($d[0])] = trim($d[1]);
        }
        return $result;
    }
98403
def splitN(line, n):
    
    x0, y0, x1, y1 = line

    out = empty((n, 4), dtype=type(line[0]))
    px, py = x0, y0
    dx = (x1 - x0) / n
    dy = (y1 - y0) / n

    for i in range(n):
        o = out[i]
        o[0] = px
        o[1] = py
        px += dx
        py += dy
        o[2] = px
        o[3] = py
    return out
1374357
private String trim(String line) {
        char[] chars = line.toCharArray();
        int len = chars.length;

        while (len > 0) {
            if (!Character.isWhitespace(chars[len - 1])) {
                break;
            }
            len--;
        }

        return line.substring(0, len);
    }
560632
function(value) {
		var ret = [];
		var linesAndNewlines = value.split(/(\n|\r\n)/);
		// Ignore the final empty token that occurs if the string ends with a new line
		if (!linesAndNewlines[linesAndNewlines.length - 1]) {
			linesAndNewlines.pop();
		}
		// Merge the content and line separators into single tokens
		for (var i = 0; i < linesAndNewlines.length; i++) {
			var line = linesAndNewlines[i];
			if (i % 2) {
				ret[ret.length - 1] += line;
			} else {
				ret.push(line);
			}
		}
		return ret;
	}
498743
public static String[] disectCommandLine(String line) {
		return StringSupport.split(line, "() ,;", "\"", false, false, false).toArray(new String[0]);
	}
371094
def _cut_line(line):
        
        # punct = '"#$%&\'()*+/<=>?@[\\]^`{|}~'
        if re.search("([\t\n\r]+|[\x0b\x0c ]{3,})+", line):
            tmp = re.split("([\t\n\r]+|[\x0b\x0c ]{3,})+", line, 1)
        else:
            tmp = re.split("[" + string.whitespace + "]+", line, 1)
        res = [elt.strip() for elt in tmp if elt.strip() != '']
        return res
437984
def _split_lines(self, original_lines: List[str]) -> List[str]:
        
        console_width = get_console_width()
        # We take indent into account only in the inner group lines.
        max_line_length = console_width - len(self.LINE_SEP) - self._last_position - \
            (self.indents_sum if not self._is_first_line else self.indents_sum - self._indents[-1])

        lines = []
        for i, line in enumerate(original_lines):
            fixed_line = []
            colors_counter = 0
            line_index = 0
            while line_index < len(line):
                c = line[line_index]

                # Check if we're in a color block.
                if self._colors and c == self._ANSI_COLOR_PREFIX and \
                        len(line) >= (line_index + self._ANSI_COLOR_LENGTH):
                    current_color = line[line_index:line_index + self._ANSI_COLOR_LENGTH]
                    # If it really is a color, skip it.
                    if self._ANSI_REGEXP.match(current_color):
                        line_index += self._ANSI_COLOR_LENGTH
                        fixed_line.extend(list(current_color))
                        colors_counter += 1
                        continue
                fixed_line.append(line[line_index])
                line_index += 1

                # Create a new line, if max line is reached.
                if len(fixed_line) >= max_line_length + (colors_counter * self._ANSI_COLOR_LENGTH):
                    # Special case in which we want to split right before the line break.
                    if len(line) > line_index and line[line_index] == self.LINE_SEP:
                        continue
                    line_string = ''.join(fixed_line)
                    if not line_string.endswith(self.LINE_SEP):
                        line_string += self.LINE_SEP
                    lines.append(line_string)
                    fixed_line = []
                    colors_counter = 0
                    self._last_position = 0
                    # Max line length has changed since the last position is now 0.
                    max_line_length = console_width - len(self.LINE_SEP) - self.indents_sum
                    self._is_first_line = False

            if len(fixed_line) > 0:
                fixed_line = ''.join(fixed_line)
                # If this line contains only color codes, attach it to the last line instead of creating a new one.
                if len(fixed_line) == self._ANSI_COLOR_LENGTH and self._ANSI_REGEXP.match(fixed_line) is not None and \
                        len(lines) > 0:
                    lines[-1] = lines[-1][:-1] + fixed_line
                else:
                    lines.append(fixed_line)
        return lines
638344
public static List<String> splitStringCommaSpace(String line) {
		List<String> words=new ArrayList<>();
		int len=line.length();
		int pos=0;
		while(pos<len) {
			// Skip past blank space
			char ch;
			while(pos<len && ((ch=line.charAt(pos))<=' ' || ch==',')) pos++;
			int start=pos;
			// Skip to the next blank space
			while(pos<len && (ch=line.charAt(pos))>' ' && ch!=',') pos++;
			if(pos>start) words.add(line.substring(start,pos));
		}
		return words;
	}
1320514
public static List<String> splitLines(String S) {
		List<String> V=new ArrayList<>();
		int start=0;
		int pos;
		while((pos=S.indexOf('\n', start))!=-1) {
			String line;
			if(pos>start && S.charAt(pos-1)=='\r') line = S.substring(start, pos-1);
			else line = S.substring(start, pos);
			V.add(line);
			start=pos+1;
		}
		int slen = S.length();
		if(start<slen) {
			// Ignore any trailing '\r'
			if(S.charAt(slen-1)=='\r') slen--;
			String line = S.substring(start, slen);
			V.add(line);
		}
		return V;
	}
962678
def split_line(self):
        
        # coordinate of the # symbol or end of the line (-1) if not found
        hash_or_end = self.line.find("#")
        temp = self.line[self.region_end:hash_or_end].strip(" |")
        self.coord_str = regex_paren.sub("", temp)

        # don't want any meta_str if there is no metadata found
        if hash_or_end >= 0:
            self.meta_str = self.line[hash_or_end:]
        else:
            self.meta_str = ""
1285155
function(line, index, lines) {
        if (insideString('|>', line)) return line;

        // ^\s?             // leading spaces
        // (\|\>\s*)        // |> pipe operator inc trailing spaces
        // ([\.\w_]+\s*)    // function/method name inc trailing spaces
        // (.*)             // additional (optional) params
        //
        // $0 `|> my_func take 99`
        // $1 `|>`
        // $2 `my_func`
        // $3 `99`
        //
        var regex = /^(\|\>\s*)([\.\w_]+\s*)(.*)$/;

        return line.replace(regex, function($0, $1, $2, $3) {
            var comma;
            var newLine;
            var hasLambda = $3.match(/=>/);

            // strip parens
            if (!hasLambda) {
              $3 = $3.replace(/^\(|\)$/g, '');
            }

            comma = $3 ? ', ' : '';

            newLine = '.pipesCall(' + $2.trim() + comma + $3 + ')';

            // if next line doesnt have a pipe operator
            if (!lines[index + 1].match(/^\s*\|\>/)) {
                newLine = newLine.trimRight() + '.value();';
            }
            return newLine;
        });
    }
809464
public static String[] getDataFromLine(final String line, final String seperator)
	{
		final String[] splittedLine = line.split(seperator);
		return splittedLine;
	}
362987
public static String[] splitString(String line) {
		int len=line.length();
		int wordCount=0;
		int pos=0;
		while(pos<len) {
			// Skip past blank space
			while(pos<len&&line.charAt(pos)<=' ') pos++;
			int start=pos;
			// Skip to the next blank space
			while(pos<len&&line.charAt(pos)>' ') pos++;
			if(pos>start) wordCount++;
		}

		String[] words=new String[wordCount];

		int wordPos=0;
		pos=0;
		while(pos<len) {
			// Skip past blank space
			while(pos<len&&line.charAt(pos)<=' ') pos++;
			int start=pos;
			// Skip to the next blank space
			while(pos<len&&line.charAt(pos)>' ') pos++;
			if(pos>start) words[wordPos++]=line.substring(start,pos);
		}

		return words;
	}
418054
def parse(self, line, **options):
        
        line = line.strip()
        if not line:
            return (False, (), {})
        split = line.split()
        cmd, args = split[0], split[1:]
        return (cmd, args, {})