Questions for string


Only allow English characters/letters/numbers and a few special characters

My problem is that I am making a small search engine from scratch, but it gets messed up if I search in Russian/any other language besides English. I was hoping some one could give me a code with r...

C++ character array allocation error

I have a function designed to get a file's contents:

String format a json String gives KeyError

Why does this code give a KeyError?

Python - Backslash Quoting in String Literals

I have a string that contains both double-quotes and backslashes that I want to set to a variable in Python. However, whenever I try to set it, the quotes or slashes are either removed or escaped. ...

StringBuilder.AppendLine() does not make a new line

I am generating an email when an error occurs. I am using StringBuilder.AppendLine() and StringBuilder.AppendLine(String) to build up the body of the email, however the body of my email appears as ...

Erasing a Char

Okay i am working on someone elses code. They do alot of this:

JAVA: 128-bit key to String problem and back

I have created a SecretkeySpec object wich contains a 128 bit key.

What does it mean when string 1 is “less than” string 2 in C?

In the documentation of the strncmp(const char *s1, const char *s2, size_t n) function of the XC8 compiler, I read:
9836 character replacement in strings

How fast can I replace characters in a string?

Can't pass pointers to scanf(“%s”,ptr);

So I commented out the scanf part (and just initialized it with my own string), why does it crash if I use scanf? I believe the actual arguments I've put in scanf(); are correct.

Java split string at “,” and end of line

I have some data that looks like this:

How to make a random but partial shuffle in Python?

Instead of a complete shuffle, I am looking for a partial shuffle function in python.

Removing information from a string

I'm using an API which uses the users IP address to find out the users Country Location and City, however I have never used regex before and I have no Idea how to extract the other information I wa...

Replace a pattern in string only if a certain condition is satisfied - Regex

how can we replace ' with \\' in a string. (this can be done using Regex.IsMatch(), Regex.Matches(), Regex.Replace()

How to pass a vector of strings to in clojure?

I am trying to make use of (require [ :refer [sh]]) to execute rsync backups in clojure. The function sh takes strings as args such as:

Splitting a string on to several different lines in Java

I have a very long string consisting of words punctuation and spaces. I am trying to modify the string to add a new line (\n) after every x characters but while preserving whole words. For example:...

How to select all characters to the right of a specific character in a string - PHP

I spent a long time trying to figure this out! How do I select all the characters to the right of a specific character in a string when I don't know how many characters there will be?

Why the program is showing always the same string?

I need to save a data that contains: name, id and rating.

Literal string creation vs String object creation

How many String object are created

Extract String from a PHP Array

Didn't see an answer that I could use so I'm going to ask.

Extract a QString from xml tag

I have this resulted QString from an http request, What I need to do is to extract only the string "一致" which is inside the tag

Ruby send string variable as hex

How am I to express variable as hex to send like-

Problems accessing my strings.xml items… i got numbers and not the string value

when from a java class i try to acces a item of my strings.xml file, i got numbers, like a mem position, and i dont get the string value of the item

Use value of string for wide string when declaring constants in C++

Using defines I am able to declare a wide string that uses the value of regular string as follows:

Removing control characters from a string in python

I currently have the following code

Most efficient way to delimit key

Say I have a string of 16 numeric characters (i.e. 0123456789012345) what is the most efficient way to delimit it into sets like : 0123-4567-8901-2345, in PHP?

Java RegEx - Illegal character dot

String filter = "a-zA-Z0-9äöüÄÖÜß-\\.";

javascript how to sort strings containing comma separated values

I would like to know how can I sort strings in javascript containing comma separated values in different order e.g.

How to convert only strings hash values that are numbers to integers

I have rows of hashes imported from several different XML database dumps that look like this (but with varying keys):

how can I count “CREATE GPL” in this case?

My DB generates 3000 lines for each process and I must count some values for a report.

How do I replace the a portion of the string with special characters

I would like to replace a certain portion of the string with "\\_\\_\\_\\_\\_"

Order by on String's substring in Linq

I have a date field for which I convert the value of the database from datetime to string format("dd-MMM-yyyy"), I need to perform sorting this string date field, but seems like when I have been do...

Parse line of delimited text with JavaScript

Hi I'm quite new to javascript and I want to get extract a text but only a part of it. For example if it extracts this text:

How do I get my output in column format?

I'm very new to Python and have a question. Currently I'm using this to calculate the times between a message goes out and the message comes in. The resulting starting time, time delta, and the Uni...

Can't Access My Extension Method

Looking for a way to check if an string contains in another ignoring upper/lower case, I found it:

Check for continuous order in array in javascript

var userInput = prompt('enter number here');

Is it possible to input a variable of some sort and compare it with another variable at the same time in C?

I was wondering if there was possibly a way where one could scan a variable and then compare it all in the same line (same time).

Handling very large strings between SQL Server and .NET code +LINQ

I have an app that needs to handle very large strings between a SQL Server database and .NET code. I have a LINQ query that generates the strings when saving them to the database, but when trying to

Select <a> which href ends with some string

Is it possible using jQuery to select all &lt;a&gt; links which href ends with "ABC"?

File with irregular spaces and tabs split/explode columnwise

So I have a very old file with thousands of lines (I guess generated by hand) and I'm trying to move them into a rdb, but the lines don't have a format/pattern to convert into columns. Say for exam...

C: Help with Custom strpos() Function

I have the following function:

Java: how to return string before char

I have the following string

WCF JSON Return Service should return Single Escape Sequence

What i am doing for changing html codes to JavaScript escapes is :

Parse string and subtract a substring

I'm parsing a http header in C and need to subtract host name from the full url.

Create Select Tag from Split String

How do I split this string:

How do I properly store encoded characters in strings.xml?

I am trying to store two carriage returns in in strings.xml but can't figure out why they are ignored. However, if I put them directly into the layout, the carriage returns work fine.

Getting the number of occurrences of one string in another string

I need to input a two strings, with the first one being any word and the second string being a part of the previous string and i need to output the number of times string number two occurs. So for

Find first occurrence of two characters

So I have dealt with this problem before and thought there would be an accepted pattern to solve the problem, but I have yet to find anything. I tried searching around and I have tried tinkering ar...

Php function to determine if a string consist of only alphanumerical characters?

Is there a Php function to determine if a string consist of only ASCII alphanumerical characters?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.