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....
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?
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...
Using this function in my C# exe, I try to pass a Unicode string to my C++ DLL:
[DllImport("Test.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
public static extern int xSetTestString(StringBuilder xmlSettings);
This is the function on the C++ DLL side:
__declspec(dllexport) int xSetTestString(char* pSettingsXML);
Before calling the function in C#, I do a MessageBox.Show(string) and it displays all characters properly. On the C++ side, I do: OutputDebugStringW((wchar_t*)pString);, but that shows that the non-ASCII characters were replaced by '?'.
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?
In a ruby on rails app, I build an array of Project Names and project id values, but want to truncate the length of the names. Current code is:
names = active_projects.collect {|proj| [proj.name, proj.id]}
I have tried to add a truncate function to the block, but am getting undefined method for class error.
Thanks in advance - I just cannot wrap my head around this yet.
i have been type some string inside textfield that is "KD-G435MUN2D"...
i already use this code for search "UD" character from that string:
<script>
var str="KD-R435MUN2D";
var patt1=/UD/gi;
document.write(str.match(patt1));
</script>
but this code doesn't work..where is my fault?
Any suggestion for a good unicode string library for Delphi 2010? Such thing as class that would contain a collection of independent functions, basically an encapsulation of functions that manipulate strings (ex: Trimlike, Character removal, Positional, Sub-string, Compare, Informational, Case, Replacement, Manipulation functions etc. ).
Thanks
How does one convert an empty string to an int using Struts2. When the application encounters this parameter with no value, like from an empty text field, it throws the following exception.
java.lang.NoSuchMethodException:
com.XXXXXXXXXXXX.setID([Ljava.lang.String;)
Where ID is an integer, and the URL is:
Something.action?ID=&other=rawr
Is there a way to do this without using an Integer (class)? Do I have to write a type converter?
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...
Hi all,
I need to load HTML and parse it, I think that it should be something simple, I pass a string with a "HTML" it reads the string in a Dom like object, so I can search and parse the content of the HTML, facilitating scraping and things like that.
Do you guys know about any thing like that.
Thanks
Hi everyone!
i'm a newbie in jQuery and i don't know how to do my homework, pls help me !
i have a String EX: this is my text, press here.
Now i put in o block character : [here]
how can a take slipt string and get text in [ ] into variable 'done'?
thankyou !
Write an Assembly Language program named “count letters” that counts the occurrences of all small and capital letters in given below string and then prints the result in the format (Caps, count:: Small, count).Strings is “bcAdBDeCEad” and it should print this result (Caps, 5:: Small, 6).The program should take address of the source string as a parameter via stack.
sorry am not a regex expert. but my request is simple, i need to match any string that has at least 3 or more characters that are matching
So for instance, we have the string "hello world" and matching it with the following:
"he" => false // only 2 characters
"hel" => true // 3 characters match found
thansk in advance.
Hi, I am getting an error when I attempt to display a datetime value in a textbox:
My code is:
txtStartDate.Text = rdrGetUserInfo.IsDBNull(14) ? String.Empty : Convert.ToString(rdrGetUserInfo.GetString(14));
The error message is: ex.Message = "Unable to cast object of type 'System.DateTime' to type 'System.String'."
Any ideas how I can resolve this?
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 am a newbie in Python. I want to substract interval time from my log file, but the problem is I cannot convert millisecond string of log file into datetime format. For example, I have 15:55:05.12345 and I want to remove 5.12345 seconds from this string, and shwow result of 15.55.00.00000 in Python. How can I do that? Currently, I am using python 2.5.
Thank you in advance.
I tried on Flex 3, facing issue with uploading JPG/PNG image, trace readUTFBytes would return correct bytes length but tmpFileContent is trucated, it would only appear to have upload just 3 characters of data to the server through PHP script which made image unusable. I have no issue for non-images format. What is wrong here?
var tmpFileContent:String = fileRef.data.readUTFBytes(fileRef.data.length);
Is String capable of handle bytes?
I'm just a newbie to ruby. I've seen a string method (String).hash .
For example, in irb, I've tried
>> "mgpyone".hash
returns
=> 144611910
how does this method works ?
I want to create my own RSS/XML feed. I fetch data from the database to display, but keep getting invalid character errors. If the string has an ampersand or other strange characters in it, the XML will be invalid.
I tried using urlencode and htmlentities, but these don't capture all possible characters which need to be escaped. Does anyone know of a PHP function which will prepare a string for XML output?
Can any one help me with this connection string. I can't manage how to fix.
Dim constring As String
Dim con As SqlCeConnection
Dim cmd As SqlCeCommand
constring = "(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + \\database.sdf;Password=pswrd;File Mode=shared read"
con = New SqlCeConnection()
con.Open()
Thanks
I need to have a list with id's for each list item being #one, #two etc.
Is this the most efficient way or am I missing an in built ruby function here?
-num_array = ["one", "two", "three", "four", "five", "six", "seven"]
-navigation[:primary_level].each_with_index do |primary_item, idx|
%li{ :id => "#{num_array[idx]}"}
Hi everybody!
I have to set some routing rules in my php application, and they should be in the form
/%var/something/else/%another_var
In other words i beed a regex that returns me every URI piece marked by the % character, String marked by % represent var names so they can be almost every string.
another example:
from /%lang/module/controller/action/%var_1
i want the regex to extract lang and var_1
i tried something like
/.*%(.*)[\/$]/
but it doesn't work.....
I need to send image data over network using HttpSendRequest POST request.
For this purpose I am creating a string , adding some parameters to string, then I need to add raw image data.
Now I would like to know how can I send the image in post request.