---
schema_version: "1"
id: d55fac04c4c3c85fa01b6825eb736f9fa56be14289e3b63faf8a583122d13ebb
title: last (最後)
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.8/dw-strings-functions-last.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.8/dw-strings-functions-last
source_site: docs.mulesoft.com
content_type: documentation
content_hash: e189e326fac6c45cb4b7f708389b96a868c9bfb8e1cceaef53b0309215b9991b
description: MuleSoft Documentation Site
release: "2.8"
latest: false
---
# last (最後)

## [](#last1)last(text: String, amount: Number): String

文字列の末尾から指定された文字数までの文字 (たとえば、文字列内の最後の 2 文字) までの文字を返します。

_DataWeave バージョン 2.4.0 で導入されました。_

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>text</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">処理する文字列。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>amount</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">返す文字の数。負の数と ​<code>0</code>​ では空の文字列が返されます。小数は最も近い整数に切り上げられます。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、文字列内の最後の 6 文字を返します。

#### [](#ソース)ソース

```DataWeave
%dw 2.0
import last from dw::core::Strings
output application/json
---
"hello world!" last 6
```

#### [](#出力)出力

```Json
"world!"
```

## [](#last2)last(text: Null, amount: Any): Null

`last`​ を ​`null`​ 値に使用できるようにするヘルパー関数。

_DataWeave バージョン 2.4.0 で導入されました。_