i need to trim a string to its first 100 characters using jquery/javascript.
also is it possible to scan a string and look for a particular combination of keywords such as #key?
thanks a lot for the help.
Hei everyone!
I have this variable in shell containing paths separated by
a space:
LINE="/path/to/manipulate1 /path/to/manipulate2"
I want to add additional path string in the beginning of the string and as well right after the space so that the variable will have the result something like this:
LINE="/additional/path1/to/path/to/manipulate1 additional/path2/to/path/to/manipulate2"
Any help appreciated
Thanks in advance
I have a buffer open in emacs. I want a function that will return t if the current buffer contains the string, otherwise it returns nil.
(defun buffer-contains-substring (string)
...
)
I am new to c# programming and I want to ask a question.
How can I get the value in () and store it in another string. example:
I have string
s1="here there (hi)";
How can I get
s2="hi";
the () will always be at the end of the sentence (never at first or in between).
Compiling my program I have this error:
/usr/include/xercesc/util/Compilers/GCCDefs.hpp:133:60: error: declaration of ‘int strcasecmp(const char*, const char*)’ has a different exception specifier
/usr/include/string.h:536:12: error: from previous declaration ‘int strcasecmp(const char*, const char*) throw ()’
make: *** [src/test/VFTImageMaterial.o] Error 1
Any idea about this conflict with string.h?
What is the preferred way to remove spaces from a string in C++? I could loop through all the characters and build a new string, but is there a better way?
I have a series of value that include the empty string
levels(mydata$phone_partner_products)
"" "dont_know" "maybe_interesting"
"not_interesting" "very_interesting" "very_not_interesting"
If I make a frequencies table I get this
table(mydata$phone_partner_products)
dont_know maybe_interesting
3752 226 2907
not_interesting very_interesting very_not_interesting
1404 1653 1065
How can I reorder the columns in a more meaningful way?
How can I rename the empty string "" level?
Thank you a lot in advance.
Need to get a value of an enumeration of a given string literal like "xlCenter" (these values are cut and pasted from Excel Macro).
I would like to retrieve the actual constant value (int) -4108="xLCenter" via com marshaling is this possible ? if so how ?
Ideally I am looking for function like this
public int ExcelConstant(string constantName)
{ ...}
Thanks
I am trying to parse a list of operating system instances with their unique identifiers. I am looking for a solution to parse a text string, and pass the values into two variables. The string to be parsed is as followed:
"Ubuntu 9.10" {40f2324d-a6b2-44e4-90c3-0c5fa82c987d}
While reading a file I get broken UTF-8 String error whenever I have the following in my file
través
if I change it to normal e then it works.
Whats the way to fix this?
error only happens if I do line.lstrp or any other function. Just printing the lines is ok.
problem even happens when I try to match the string with regex.
I'm having a string where i'm using some placeholders to replace it with some values based on an object.
It is like the following:
Hello User <#= UserName #>
I need to replace the <#= UserName # with a value.
How can this be done with a regex? Please help. I dont want a string replace solution. There are somany placeholders and hardcoding the <#= UserName # and replace with the value is pointless
I need help with creating a C# method that returns the index of the Nth occurance of a character in a string.
For instance, the 3rd occurance of the character 't' in the string "dtststx" is 5.
So I have a string like this (the hashtags are delimiters)
A1###B2###C3###12345.jpg
I was wondering how would I access A1, B2 and C3
STRING1###STRING2###STRING3###STRING4.jpg
SOME###THING###HERE###MEH.jpg
EXTRACT###THIS###PLEASE###pah.jpg
In one instance I'd like to extract the first string. In another the second, in another the third. I will be using this with Adobe Bridge to extract metadata items from the filename
I am looping through each filename so would need
Var1 = FirstString
Var2 = SecondString
Var3 = ThirdString
Hi there
I want to convert a string to a generic type
I have this:
string inputValue = myTxtBox.Text;
PropertyInfo propInfo = typeof(MyClass).GetProperty(myPropertyName);
Type propType = propInfo.PropertyType;
object propValue = ?????
I want to convert 'inputString' to the type of that property, to check if it's compatible
how can I do that?
tks
Hi all,
I have a string as below:
"http:172.1." = (10, 1,3);
"http:192.168." = (15, 2,6);
"http:192.168.1.100" = (1, 2,8);
The string inside " " is a Tag and inside () is the value for preceding tag.
What is the regular expression that will return me:
Tag: http:172.1.
Value: 10, 1,3
What is the most straightforward way of making dictionary or list from a string in Python? Let's say I have string "{ 'x' : 3, 'y' : 4 }" and I want to parse it to a real dictionary object.
var str = 'single words "fixed string of words"';
var astr = str.split(" "); // need fix
i want the array to be like: single, words, fixed string of words.
Having troubles finding a good way to get a string from a text file (separated by line breaks) randomly.
I want to do a setStringValue:@"random string from file here";
pretty much. Thanks in advance.
I have a string in my database that represents an image. It looks like this:
0x89504E470D0A1A0A0000000D49484452000000F00000014008020000000D8A66040....
<truncated for brevity>
When I load it in from the database it comes in as a byte[]. How can I convert the string value to a byte array myself. (I am trying to remove the db for some testing code.)
I have a hexadecimal string "41464353". I want to convert it into bytes. I know the value of this hex string in byte will be "65706783". I want this as answer. Please give me a program for this in Java.
Let's say I have something like 30-10-2025 12:53, how could I convert that to an NSDate? I guess there's some class that takes this plus an format string that tells it how the date looks as a string, so it can parse it... where must I look?
I've built an API using actionwebservice and when a client calls a method to pass in an empty string (""), it's to_s value is # instead of "". But when the client passes in "hello", it's to_s value is "hello".
class UsersApiController < ApiController
web_service_api UserApi
def create_or_update(arg1)
Rails.logger.info arg1.to_s # Displays "#<SOAP::Mapping::Object:0x3a89c08>" if arg1 is an empty string
end
end
Hi,
I want to check whether a string starts with any character in a list. My current implementation in C# is as follows:
char[] columnChars = new char[] { 'A', 'B', 'C', 'D', 'E' };
private bool startWithColumn(string toCheck)
{
for(int i=0; i<columnChars.Length; i++)
if (toCheck.StartsWith(columnChars[i]+""))
{
return true;
}
return false;
}
I would like to know if any solution is better?