0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

begings_with:Godotの1番嫌いな所と聞かれたら、文字列の開始がbegins_withな所

Posted at

たしか、godotはpythonに似せてるはずなのに、文字列の開始文字を調べるのに、begins_withを採用してます。普通は、starts_withだろうと

Godotはbegins_with です。

今日は、Web Exportを試していました。

以下のコードがなぜか、trueにならなくて悩んでましたが、メソッド名間違えてました。

func _is_image_url(url):
	return url.starts_with("http") #web export not check grammer at all

しかも、WebExportのJavaScriptだとエラーにもならないので、原因特定まで時間かかってしまいました。

他に気をつけたいこと

あと、これには関係なく、文字の先頭に、改行やスペースが混じっていることがあるので、url.strip_escapes()も必要です。もちろん、urlのnull チェックも必要になります。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?