string-manipulation

How are text editors generally implemented?

This question is probably going to make me sound pretty clueless. That's because I am. I'm just thinking, if I were hypothetically interested in designing my own text editor GUI control, widget, or whatever you want to call it (which I'm not), how would I even do it? The temptation to a novice such as myself would be to store the conte...

How can I get, manipulate and replace a text node using jQuery?

Here is my code: <li class="det_price"> <a href="/designer/customize/278258?dpid=1">Printing</a> from $10 </li> I have about fifteen chunks like this on any given page, and I'd like to take the text node (from $X), select X using a regular expression and set it to a numeric variable, then multiply it by a %, and append it to the ...

Convert number into hex value in .net

Hi, i need to convert integer number to hex value that will look like this: 0x0201cb77192c851c When i do in C# string hex = int.ToString("x") it returns me this: 201cb77192c851c How can i achieve needed result? ...

Reg~x for the N~number

Hi All, Would be grateful your help. What would be elegant Regx to check a String whether it holds a number ? any suggestions? thanks. ...

updating hyperlinks to the text in a paragraph:interview question

One Interview question i was asked in an interview and i was not get an solution. Following is the sample paragraph and our program should give the hyperlinks for the words which mathes "Network protocol Driver- A net-protocol fully Java technology-enabled driver translates JDBC API calls into a DBMS-independent net protocol which is t...

Most efficient way to make the first character of a String lower case?

Given an input String, what is the most efficient way to make just the first character lower case? I can think of a number of ways to do this. For example, using charAt and subString: String string= "SomeInputString"; string = Character.toLowerCase( string.charAt(0)) + (string.length() > 1 ? string.substring(1) : ""); Or using a ch...

How do I get these values from a string?

The webservice returns the following string "ID: xxxx Status: yyyy" How do I get the value ID value without the "ID :" text, and "Status" value without the "Status: " text. Id value should be xxxx Status value should be yyyy the value length is unknown. ...

Get values from string?

How to get the error number and error description from this string s = "ERR: 100, out of credit"; error should equal "100" error description should equal "out of credit" ...

javascript quotes inside quotes, string literal issue

I am trying to display text in a javascript tooltip I keep getting unterminated string literals even though: a) the quotes are being slashed, b) there are no line breaks The text I am trying to display is: "No, we can't. This is going to be terrible." (its a quotation from an individual and I want those quotes to display in the tool...

how to pass a substring without actually creating an temporary object in c++

Lets say I have a function str_rev(string &s, int len) {} which reverses the string s of length len I want to reverse a substring of long string starting at index 5 and of length 10 for this I was forced to first call substring function and then call the str_rev function passing the substring sub_string = long_str.substr(5, 10) st...

string conversion

Hi there, I’ve got a long string object which has been formatted like this myString = “[name = john, family = candy, age = 72],[ name = jeff, family = Thomson, age = 24]” of course the string is longer than this. Also i have 3 lists with related names: Names = [] Families = [] Ages = [] I want to read that string character b...

PHP - split a string if its contain words longer more than 5 chars

Hi. As topic said, I need a recursive function that split a string if its contain words longer more than (for example) 5 chars. Example : if i have the string "aaaaa aaa a aaaa aaaaa" its ok; if i have the string "aaaaa bbbbbb aa aaaaa" I need to split 1 time (and, for example, add the char # before the first bbbbb and the last b). So...