Make a C array using the given string.
332940
def bytes_to_c_array(data):
    
    chars = [
        "'{}'".format(encode_escape(i))
        for i in decode_escape(data)
    ]
    return ', '.join(chars) + ', 0'
555700
public static String[] toArrayElement(String s) {
    return (s == null || s.length() == 0) ? new String[0] : new String[]{s};
  }
808083
def convert_string(string, chars=None):
    """"""
    if chars is None:
        chars = [',', '.', '-', '/', ':', '  ']

    for ch in chars:
        if ch in string:
            string = string.replace(ch, ' ')
    return string
1311459
def from_string(self, value):
        """"""
        # Remove optional []
        if value.startswith('[') and value.endswith(']'):
            text = value[1:-1].strip()
        else:
            text = value.strip()
        # Result is a list
        result = []
        # If value starts with '(' assume a list of pairs
        if text.startswith('('):
            tokens = text.split(',')
            if len(tokens) % 2 != 0:
                raise ValueError('not a valid list of pairs')
            pos = 0
            while (pos < len(tokens)):
                val1 = float(tokens[pos].strip()[1:].strip())
                val2 = float(tokens[pos + 1].strip()[:-1])
                result.append((val1, val2))
                pos += 2
        else:
            for val in text.split(','):
                result.append(float(val))
        # Ensure that the result contains at least two elements
        if len(result) < 2:
            raise ValueError('invalid number of elements in list: ' + str(len(result)))
        return result
578484
private static int add(int set[], StringBuffer str)
    {
        int result = str.length();

        for (int i = result - 1; i >= 0; i --) {
            add(set, str.charAt(i));
        }
        return result;
    }
1352940
function arrayLikeToString(array) {
      // Performances notes :
      // --------------------
      // String.fromCharCode.apply(null, array) is the fastest, see
      // see http://jsperf.com/converting-a-uint8array-to-a-string/2
      // but the stack is limited (and we can get huge arrays !).
      //
      // result += String.fromCharCode(array[i]); generate too many strings !
      //
      // This code is inspired by http://jsperf.com/arraybuffer-to-string-apply-performance/2
      var chunk = 65536;
      var result = [], len = array.length, type = JSZip.utils.getTypeOf(array), k = 0;

      while (k < len && chunk > 1) {
         try {
            if (type === "array" || type === "nodebuffer") {
               result.push(String.fromCharCode.apply(null, array.slice(k, Math.max(k + chunk, len))));
            } else {
               result.push(String.fromCharCode.apply(null, array.subarray(k, k + chunk)));
            }
            k += chunk;
         } catch (e) {
            chunk = Math.floor(chunk / 2);
         }
      }
      return result.join("");
   }
164423
def c_str(string):
    """""""
    if not isinstance(string, str):
        string = string.decode('ascii')
    return ctypes.c_char_p(string.encode('utf-8'))
177499
function stringToArrayBuffer(string) {
            var
                buffer = new ArrayBuffer(string.length),
                int8Array = new Uint8Array(buffer);
            
            for (var i = 0; i < string.length; i++) {
                int8Array[i] = string.charCodeAt(i);
            }
            
            return buffer;
        }
596847
public static function stringToArray(?string $string): array {
        $result = [];
        $strLen = \strlen($string);
        if (null === $string) return $result;
        if (1 === $strLen) {
            $result[] = $string;
            return $result;
        }
        for ($i = 0; $i < $strLen; $i++) {
            $result[] = $string[$i];
        }
        return $result;
    }
203227
public static String fill (char c, int count)
    {
        char[] sameChars = new char[count];
        Arrays.fill(sameChars, c);
        return new String(sameChars);
    }
997646
def text_to_char_array(original, alphabet):
    
    """
    return np.asarray([alphabet.label_from_string(c) for c in original])
1181687
def newarray(self, length, value=0):
        """"""
        if self.bitdepth > 8:
            return array('H', [value] * length)
        else:
            return bytearray([value] * length)
175500
def C_dict2array(C):
    """"""
    return np.hstack([np.asarray(C[k]).ravel() for k in C_keys])
1225384
public String toSimp(String str) {   
		char[] c = str.toCharArray();
		for (int i = 0; i < str.length(); i++) {   
			char cc = l2s.get(c[i]);
			if (cc != 0) {   
				c[i] = cc;   
			} 
		}   
		return new String(c);   
	}
452977
public static String[] asStringArray(List<String> input) {
		String[] result = new String[input.size()];

		for (int i = 0; i < result.length; i++) {
			result[i] = input.get(i);
		}

		return result;
	}
184187
private int[] toCodePointArray(final String text) {
        final int length = text.length();
        final int codePointLength = text.codePointCount(0, length);

        int[] array = new int[codePointLength];
        for(int i=0, j=0, codePoint=0; i < length; j++, i+=Character.charCount(codePoint)) {
            codePoint = text.codePointAt(i);
            array[j] = codePoint;
        }

        return array;
    }
238900
function (str, n) {
      n = window.parseInt(n, 10);
      return new Array(n + 1).join(str);
    }