Category "string"

Postscript: how to convert a integer to string?

In postscript , the cvs *operator* is said to convert a number to a string. How should I use it ? I tried : 100 100 moveto 3.14159 cvs show or 100 100 movet

What is a Python bytestring?

What's a Python bytestring? All I can find are topics on how to encode to bytestring or decode to ASCII or UTF-8. I'm trying to understand how it works under th

Convert string into binary in Hive

I want to match user ids from two tables in Hive. Unfortunately they are stored in different formats. In one table they are binary whereas in the second table t

Nodejs: convert string to buffer

I'm trying to write a string to a socket (socket is called "response"). Here is the code I have sofar (I'm trying to implement a byte caching proxy...): var ht

String plus Char - what is happening?

I'm just curious about what is going on when trying to add a char to a string. Initially, I thought it would work like a concatenation but it didn't: cout<&l

c++11/regex - search for exact string, escape [duplicate]

Say you have a string which is provided by the user. It can contain any kind of character. Examples are: std::string s1{"hello world"); std::

How to insert a new line in strings in Android

I'm creating an android application and within it there is a button that will send some information in an email, and I don't want to have everything all in one

Replace multiple whitespaces with single whitespace in JavaScript string

I have strings with extra whitespace characters. Each time there's more than one whitespace, I'd like it be only one. How can I do this using JavaScript?

check if string exists in a file

I have the following piece of code which opens a text file and reads all the lines in the file and storing it into a string array. Which then checks if the st

std::regex escape special characters for use in regex

I'm string to create a std::regex(__FILE__) as part of a unit test which checks some exception output that prints the file name. On Windows it fails with:

How to order strings case-insensitively (not lexicographically)?

I'm attempting to order a list input from a file alphabetically (not lexicographically). So, if the list were: C d A b I need it to become: A b C d Not the

Check if a JavaScript string is a URL

Is there a way in JavaScript to check if a string is a URL? RegExes are excluded because the URL is most likely written like stackoverflow; that is to say that

Evaluate command line argument as boolean expression

I'm trying to take a string, passed as an argument, and evaluate it as a boolean expression in an if conditional statement. For example, the user invokes MyPro

Core Data - can't set empty string as default value for attribute

I have an entity in my datamodel with a string attribute that is currently optional, and I'd like to convert this to a required attribute with a default value o

Putting C++ string in HTML code to show value on webserver

I've set up a webserver running on ESP8266 thats currently hosting 7 sites. The sites is written in plain HTML in each diffrent tab in the arduino ide. I have i

How can I get the correct output in this program?

(1)Prompt the user to enter two words and a number, storing each into separate variables. Then, output those three values on a single line separated by a space.

PHP random string generator

I'm trying to create a randomized string in PHP, and I get absolutely no output with this: <?php function RandomString() { $characters = '01

How to separate letters and digits from a string in php

I have a string which is combination of letters and digits. For my application i have to separate a string with letters and digits: ex:If my string is "12jan"

PHP: How to quickly split a key=value file into associative array

When you send a PDT transaction ID back to paypal, you get back a list of transaction data. It has SUCCESS on the first line, and then a list of key=value pairs

What is the correct way to check for string equality in JavaScript?

What is the correct way to check for equality between Strings in JavaScript?