本ブログは更新を停止しました。Aerieをよろしくお願いいたします。
投稿カレンダーはJavaScriptが有効でない環境では使用できません。
αετο? / aetos / あえとす
シャノン? 誰それ。
埼玉を馬鹿にする奴は俺が許さん。
基本的に知ったかぶり。興味を持った技術に手を出して、ちょっと齧りはするものの、それを応用して何か形にするまでは及ばずに飽きて放り出す人。
さっぱり仕様がわかりません。第2および第3引数の意味を誰か教えてくださいorz
投稿日時 : 2007年9月21日 13:13
これですか? http://msdn2.microsoft.com/ja-jp/library/ms224421(VS.80).aspx ・・・なんだこれwややこしw startIndex から count の文字数分前のトコまでが検索範囲?w
String.LastIndexOf(target, start, count) start番目からのcount個の文字を検索の対象にすっぞ! ...って意味ちゃうんかなー
こうかな? 1. startIndexの位置で比較する 2. 一致したら、終了 3. startIndexとcountとを、1減らす 4. countが0なら、終了 5. 1.に戻る
public class Program { public static void Main() { string source = "01234567890123456789"; char target = '8'; int start = 10; int count = 10; int result = source.LastIndexOf(target, start, count); System.Console.WriteLine(result); } } 8が返ってまいりました。 start位置からcount個遡りますですねー んなわけで とりこびっち がせーかい。
>8が帰ってまいりました。 なぬっ!? じゃあ、原文から間違ってるジャン?
この検索は、startIndex の文字位置から開始し、 value が見つかるか、 count の文字位置に到達するまで、← ここがウソ♪ 逆方向に検索を実行します。 The search begins at the startIndex character position and proceeds backwards until either value is found or count character positions have been examined. 原文では"count個の文字位置を調べ尽くすまで"だな。 翻訳のマチガイですねー
startIndex から検索方向にcountするのか、文字列方向なのか、ですね。 >逆方向に検索を実行します。 コレが混乱するw
あー。 startIndex が指す文字も検索対象になるのかー。 ん…そーすっとアレもまずいな。直しとこう。
まとめ。 ●ArgumentOutOfRangeExceptionが出る条件 ・startIndex + 1 - count < 0 ・startIndex >= string.Length ●このメソッドの挙動 startIndexが指す文字を含め、そこから前にcount文字を検索対象とする。 例: CABを検索対象とするため見つからない。 "ABCABC".LastIndexOf("ABC", 4, 3 ) -> -1 後ろの ABC が検索対象となる。 "ABCABC".LastIndexOf("ABC", 5, 3 ) -> 3
いや、ArgumentOutOfRangeException の Condition 「count plus startIndex specify a position that is not within this instance. 」 が。 つか、今まで完全に間違ってたかも。 startIndex →→→→ startIndex + count で、count から逆方向に探すと思って…。
あー、そこか。確かに。 startIndexからcount回'逆方向'に検索すんだから、 「startIndex - count がマイナスになったら例外throw」がせーかいなのかな。
> count plus startIndex specify a position that is not within this instance. 英語の MSDN では、そう書いてあるところは見当たらないけど… でも、英語の例外ドキュメントもめちゃくちゃ。 http://msdn2.microsoft.com/en-us/library/0w96zd3d.aspx ArgumentNullExceptionが書いてあるけど、char が null ってあり得るの? http://msdn2.microsoft.com/en-us/library/1tw91fa3.aspx startIndex is less than zero or greater than the length of this instance. 実際には startIndex >= length で落ちます。 http://msdn2.microsoft.com/en-us/library/ms131439.aspx startIndex or count is less than zero or greater than the length of this instance. もう何言ってんだかわかりません。 別の問題もあるみたい… http://d.hatena.ne.jp/melt_slinc/20061122
> 「startIndex - count がマイナスになったら例外throw」がせーかいなのかな。 ううん。 startIndex = 5 のとき、文字列の先頭までは 6 文字あるので、count > 6 だと落ちます。 startIndex - count >= -1 までは許容範囲。
うっひょ~。混乱してきたぁ! http://msdn2.microsoft.com/en-us/library/d0z3tk9t(VS.80).aspx http://msdn2.microsoft.com/en-us/library/d0z3tk9t.aspx
衝撃の事実! URL の末尾が無印なら最新!? http://msdn2.microsoft.com/ja-jp/library/d0z3tk9t.aspx
うおぉぉぉorz (VS.80)が英語版も間違えてやがったのか… そりゃローカライズチームを責めるのは酷ってものか。
>衝撃の事実! >URL の末尾が無印なら最新!? >http://msdn2.microsoft.com/ja-jp/library/d0z3tk9t.aspx まるで今指摘されて書き直したようなwwww
なんだかなー でもでも、 インスタンスの startIndex の文字位置から開始し、value が見つかるか、"count の文字位置に到達するまで"、インスタンスの先頭へ向かって逆方向に検索を実行します。 んとこは依然マチガイよねぇ? countは'位置'じゃなく'数'だもん。
原文も紛らわしいが、正しくは「count個の文字位置を調べるまで」のようですね。 count character positions have been examined.
というか概要とか引数の説明にはちゃんと書いてある。 > 検索は指定した文字位置から開始され、指定した数の文字位置が検査されます。 > count > 検査する文字位置の数。 「文字位置の数」ってのがややこしいね。「文字数」でいいじゃないの。 epiさんの意見を反映して投稿しときました。 http://forums.microsoft.com/MSDN-JA/ShowPost.aspx?PostID=2170967&SiteID=7
「文字位置の数」ってのがややこしいね。「文字数」でいいじゃないの。 str.LastIndexOf("ABC",...) てーときに「文字数」では余計にわけわからんってことでわないかと。
2n1UYb Current blog, fresh information, I read it from time to time!!...
Honestly, not bad news!...
I do`t see a feedback or the other coordinates from the blog administration!...
Every time I come back here again and don`t get disappointed..!
52. "The road will be overcome by that person, who goes." I wish you never stopped and be creative - forever..!
Extremely easy by words but in reality?, a lot of things don`t correspond. Not everything is so rosy..!
Sometimes I also see something like this, but earlier I didn`t pay much attention to this!...
It's straight to the point! You could not tell in other words! :D
Thanks for all the answers:) In fact, learned a lot of new information. Dut I just didn`t figure out what is what till the end!...
Hello just happened upon your website from Google after I entered in, "%BLOGTITLE%" or perhaps something similar (can't quite remember exactly). Anyways, I'm grateful I found it simply because your content is exactly what I'm searching for (writing a college paper) and I hope you don't mind if I collect some information from here and I will of course credit you as the source. Thanks for your time. the tao of badass pdf http://sharpdetails.com/wp-includes/TaoOfBadass.html
Hello! I was interested to know if setting up a blog website such your own: %BLOGURL% is hard to do for inexperienced people? I've been wanting to develop my own website for a while now but have been turned off mainly because I've always assumed it required tons of work. What do you think? Many thanks the venus factor pdf http://destinationornot.com/wp-includes/thevenusfactor.htm
???? ?? ??? ??? ??? ????? ?????
se o cara ta mostrando como baixa como nao existe?? se vc é burro é outra historia
Its such as you learn my thoughts! You appear to grasp a lot approximately this, such as you wrote the guide in it or something. I feel that you just can do with some p.c. to force the message home a bit, but other than that, that is excellent blog. A great read. I will definitely be back.
A linguagem conduz à socialização das ações.
My brother recommended I might like this website. He was totally right. This post actually made my day. You can not imagine just how much time I had spent for this information! Thanks!
We are a bunch of volunteers and opening a new scheme in our community. Your web site offered us with valuable info to work on. You've performed an impressive job and our whole community will be thankful to you.
Hey there just wanted to give you a quick heads up. The words in your content seem to be running off the screen in Chrome. I'm not sure if this is a format issue or something to do with internet browser compatibility but I thought I'd post to let you know. The style and design look great though! Hope you get the problem solved soon. Kudos
What's up friends, pleasant article and fastidious arguments commented here, I am genuinely enjoying by these.
Hi there, after reading this remarkable paragraph i am too happy to share my know-how here with mates.
Your style is unique compared to other folks I have read stuff from. Many thanks for posting when you have the opportunity, Guess I will just book mark this site.
It's nearly impossible to find experienced people on this topic, however, you sound like you know what you're talking about! Thanks
A person necessarily lend a hand to make seriously posts I might state. That is the very first time I frequented your website page and thus far? I surprised with the analysis you made to create this actual put up incredible. Wonderful job!
I was suggested this website by my cousin. I'm not sure whether this post is written by him as nobody else know such detailed about my difficulty. You are wonderful! Thanks!
Helpful information. Lucky me I found your website accidentally, and I'm shocked why this twist of fate did not took place earlier! I bookmarked it.
Hi everybody, here every person is sharing these familiarity, thus it's good to read this web site, and I used to pay a quick visit this blog every day.
Everyone loves what you guys are usually up too. This kind of clever work and reporting! Keep up the amazing works guys I've added you guys to blogroll.
Artigo muito bom, apresenta muito bem as informações, é o que verdadeiramente interessa. Este site está de parabéns. Vale a pena ler na integra.
eu adoro quando me deparo com artigos tão bem redigidos quanto o que pude encontrar aqui . Continuarei visitando seu site já que adorei dos seus artigos .
Powered by: Copyright © αετος / aetos