Questions for string


1491

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...
4781

C++ character array allocation error

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

String format a json String gives KeyError

Why does this code give a KeyError?
2328

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. ...
6541

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 ...
9401

Erasing a Char

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

JAVA: 128-bit key to String problem and back

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

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

vb.net character replacement in strings

How fast can I replace characters in a string?
9670

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.
2884

Java split string at “,” and end of line

I have some data that looks like this:
718

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.
6602

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...
8443

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()
4313

How to pass a vector of strings to java.shell in clojure?

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

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:...
6494

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?
7540

Why the program is showing always the same string?

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

Literal string creation vs String object creation

How many String object are created
5325

Extract String from a PHP Array

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

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
809

Ruby send string variable as hex

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

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
2439

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:
7503

Removing control characters from a string in python

I currently have the following code
5421

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?
3964

Java RegEx - Illegal character dot

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

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.
9043

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):
3268

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.
4036

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 "\\_\\_\\_\\_\\_"
4968

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...
8809

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:
9596

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...
9605

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:
5744

Check for continuous order in array in javascript

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

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).
5597

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
5571

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"?
9518

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...
7067

C: Help with Custom strpos() Function

I have the following function:
4206

Java: how to return string before char

I have the following string
2364

WCF JSON Return Service should return Single Escape Sequence

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

Parse string and subtract a substring

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

Create Select Tag from Split String

How do I split this string:
7134

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.
5207

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
8091

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...
6104

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.