It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
class or instance method for checking string is valid integer?
You can use NSScanner for that. NSString itself also has -doubleValue and -intValue methods.
If you're looking at the ENTIRE string, rather than just a portion, you could just use -intValue or -doubleValue. If it returns non-zero, it's valid.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm trying to write a script which will convert all letters from lowercase to uppercase without using the uc() function.
You could use something like $str =~ tr/a-z/A-Z/, but uc is probably better for Unicode support, if it matters to you.
Using regular expressions:
$str =~ s/(.)/\u$1/g;
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
The following snippet compiles and runs fine
When using as part of worksheet, i see error
Why is this please?
It's probably just a bug/missing feature.
By the way, you could write joiner like the following code to get the same behaviour, and it also will avoid the worksheet problem.
def joiner(strings: List[String], separator: String = " ") =
strings.mkString(separator)
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
here Im writing a perl program which to parse a file, it contians multiple line, in each line it has three fields: name, size in bytes and user.
any sample code to validates the file? for example, if I want to check if a given file through argument that it is validate file?
If this is a CSV file use a CSV parser
For eg.
http://perlmeme.org/tutorials/parsing_csv.html
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I want to process a txt file using perl. I have succeeded in using this perl code to process wikipedia txt file before, so it is correct. But when I run the perl code, there appears an error:
utf8 "\xA1" does not map to Unicode at xxx
I check the txt file. There is \xA1 characters in it. I tried to remove those "\xA1" with RegEx s/(\xa1)+//g; but failed.
So what is the problem and how can I solve this?
At last, I revise my code. I use
binmode( IN, ':stdio' );
instead of
binmode( IN, ':utf8' );
and it works.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am new to iphone.I have facing some issue.I have a list of strings such as
1.mp3
2.mp3
3.mp3
here i want to eliminate all .mp3 and get only the number 1,2,3 how it is possible.If any body know this please help me..
If the item you want to remove is always a file extension:
NSString *strippedString = [filename stringByDeletingPathExtension];
NSString * str =#"1.mp3";
if ([str hasSuffix:#".mp3"])
{
str = [str stringByDeletingPathExtension];
NSLog(#"%#",str);
}