How should I go about implementing a method that gets a String composed of Latin characters to translate it into a String composed of a different set of characters, let's say Cyrillic.
Hi I have a JSON string that looks like this (Usingt Rails and a REST service)
{
person:
{
name:"Pepe",
last:"Smith"
hats:[ { team:"lakers", color:"purple"}, { team:"heats", color:"red" }] } }
I want to be able to able to get that JSON, and save the Person to the database, but I want to save the "hats".. as a string to the database; without parsing it or anything like that
i.e. I want to save this to SQL:
hats = "[ { team:"lakers", color:"purple"}, { team:"heats", color:"red" }] }"
Is there a way to do this in rails?
I would like to extract the number from a string in MSBuild.
How can I do that using the built in tasks or the MSBuild.Community.Tasks? (RegexMatch might do, but how?)
Example: I have the string
agent0076
and I would like to get out the number, without the leading zeros:
76
Whle decoding, I got this as out put.I am getting NSData bytes by decoding a string.I am converting NSData bytes as string then I am getting the following otu put.
-(void)decodeAction:(NSString*)str
{
NSData *data=[NSData base64DataFromString:str];
NSString *stt=[NSString stringWithFormat:@"%@",data];
printf("\n stt %s",[stt UTF8String]);
}
<4f7c204d 6c204d61 604d6164 61616461 6164616e 24616e20 4d6e204d 6e204d6f 604d6f68 616f6861 6f68616e 28616e
Does anybody have a quickie for converting an unsafe string to an int?
The string typically comes back as: '234\r\n' or something like that.
In this case I want 234. If '-1\r\n', I want -1. I never want the method to fail but I don't want to go so far as try, except, pass just to hide errors either (in case something extreme happens).
If I have the following plain string, how do I divide it into an array of three elements?
{["a","English"],["b","US"],["c","Chinese"]}
["a","English"],["b","US"],["c","Chinese"]
This problem is related to JSON string parsing, so I wonder if there is any API to facilitate the conversion.
Hi,
How to restore the value of a string after using
FormsAuthentication.HashPasswordForStoringInConfigFile()
i have a string s1 = "abc" then
FormsAuthentication.HashPasswordForStoringInConfigFile(s1, "SHA1") =
A9993E364706816ABA3E25717850C26C9CD0D89D
How can i decrypt "A9993E364706816ABA3E25717850C26C9CD0D89D" back to "abc"??
Is there any advantage to using char*'s instead of std::string?
I know char*'s are usually defined on the stack, so we know exactly how much memory we'll use, is this actually a good argument for their use? Or is std::string better in every way?
I have a bunch of records with dates formatted as a string such as '04/17/2009'
I want to convert them to a mysql datetime field
I plan to use a foreach loop to read the old date value and insert the newly formatted value into a new field in each record
what would be the best way to convert that string...I thought php might have a way to do it automatically?
thanks
String 14/04/2010 17:12:11.
How to replace the characters to get a string
14%04%2010%17%12%11
I know the method Replace, but its syntax Replace(Char,Char). I have to use it 3 times. How to write shorter? Use regular expressions? Can I do without them?
Does anyone know how to convert a list to a string in Oz? I have a list of characters I need to convert to a string and I didn't see any concatenation operator in the Oz documentation.
thanks
Hello, I have a string:
CriteriaCondition={FieldName={*EPS}*$MinValue=(-201)$MaxValue=(304)$TradingPeriod=(-1)}
Help me to get the first word which ends with the first word "={" & get the next following word which ends with "}".
The result must be:
Word1 = "CriteriaCondition"
Word2 = "FieldName={EPS}$MinValue=(-201)$MaxValue=(304)$TradingPeriod=(-1)"
And with the string "FieldName=(EPS)$MinValue=(-201)$MaxValue=(304)$TradingPeriod=(-1)", help me to split to pairs:
FieldName EPS
MinValue -201
MaxValue 304
TradingPeriod -1
Thanks.
I need an simple way to check whether a string that is sent to my function is of the form:
(x + n)(x + m)
//the +'s can be minus'
//n and m represent a double
//x represents the char 'x'
Is there a simple string format that I can use to check that this is the form. As opposed to checking each character singularly.
The whitespace will be removed to save any confusion.
Regards
Lloyd
Hello All:
I am converting a string to datetime using DateTime.TryParse in C#. Can somebody tell me, how to know which format C# compiler used to convert the string to valid DateTime. I want to know the datetime format used.
Thanks,
Ashwani
what data type (string, blob or clob) should i use for my thread body when using doctrine?
and what length should it be?
i have read the documentation but dont quite understand the differences between them.
seems that all three can store unlimited nr of characters.
could someone explain
and how do i store unlimited characters in string? what should i set as length?
I want to make a file which reads String array but initially i am having only byte array so first i want to convert it into string array, so how can i do so. Pls. help me....
hi,
i have an variable declated as an object
Object obj =e.Row.DataContext;
when i go to immediate window and check the value i get like this
?Object obj =e.Row.DataContext;
{TempTypeMinus1487405295}
People: "7,556,930"
Name: "India"
string strcounty =obj .Tostring();
now in strcounty i should get as India
but i am getting the value as TempTypeMinus1487405295
how can i get the value india in string variable
thanks in advance
I am using PHP, i want to display a string which comes as title of a post, in a textbox as value. if this title has inverted commas then the string value tag of input field terminates on that quote. now as there is an add slash function to add back slashes, is there a similar function to add forward slashes ? but just before quotes, and not any other character
According to their documentation, you should use Array hydration rather than record hydration when retrieving data for read-only purposes.
However, this means I have to access the attributes of the retrieved object using arrays and string keys:
$user['Phonenumbers'][0]['number']
instead of the OO style:
$user->PhoneNumbers[0]->number
Now I'm kinda new to PHP, but in other languages I've worked with the 2nd notation would be preferable because typos would be caught at compile time while typos in string literals would not be noticed until runtime. Does this apply to PHP/Doctrine?
How to display a string in correct format as i enter it in the textarea in ruby on rails?
actually i enter some string in the textarea as:
my name
is jamal.
now there is a next line starting after name... but i get the following in the view...
my name is jamal
which i don't want to be like that... so, how to get the correct format..?
i hope u understand...
Hi again...
Guys I'd asked 2 questions before and I'd said that I want to split a string like below:
Input string:
a=aa|b=b||b|c=cc
and the output:
a=aa
b=b||b
c=cc
some guys answer my question but they use .Match():
var matches = "a=aa|b=b||b|c=cc".match(/(?:[^|]|\|\|)+/g)
but I need to use the .split() method and store the outputs in an array.
please help me guys... It's so critical...
Thanks...
I can use the following codes to trim a string:
-(void) aMethod {
// myStr from a text box
NSString *trimedStr = [mystr stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceAndNewlineCharacterSet]];
...
// should I release trimedStr?
}
Not sure if the result trimedStr is an autorelease string? How can I find out that?
I have this situation(Java code):
1) a string such as : "A wild adventure" should match.
2) a string with adjacent repeated words: "A wild wild adventure" shouldn't match.
With this regular expression: .* \b(\w+)\b\s*\1\b.* i can match strings containing adjacent repeated words.
How to reverse the situation i.e how to match strings which do not contain adjacent repeat words
Hello
I have jsp page with text field and button. Also i have jar of another project.
When i click on the button the MAIN.class of the jar is called and program is running in independent window(JFrame).
After user is finished with the program and exits, I need to get the String of program that is generated on exit and paste it into the textbox (The String is HTML code)
Is anyone else having this problem and has a solution?
Thanks
Alex